Commit 3b88c3692690c8a440b21ac642d12235f05ddf01
1 parent
4e090de9
Exists in
master
and in
7 other branches
Inclusão de opção para selecionar todas as colunas (*) no navegador postgis
Showing
1 changed file
with
12 additions
and
1 deletions
Show diff stats
ferramentas/navegapostgis/index.js
| @@ -313,6 +313,9 @@ i3GEOF.navegapostgis = { | @@ -313,6 +313,9 @@ i3GEOF.navegapostgis = { | ||
| 313 | } | 313 | } |
| 314 | else{ | 314 | else{ |
| 315 | ins = "<table class=lista4 ><tr><td title='"+$trad('selecionaID',i3GEOF.navegapostgis.dicionario)+"'>"+gid+"</td><td title='"+$trad('selecionaGeom',i3GEOF.navegapostgis.dicionario)+"'>"+the_geom+"</td><td title='"+$trad('mostraColuna',i3GEOF.navegapostgis.dicionario)+"'>"+mostra+"</td><td>"+nome+"</td></tr>"; | 315 | ins = "<table class=lista4 ><tr><td title='"+$trad('selecionaID',i3GEOF.navegapostgis.dicionario)+"'>"+gid+"</td><td title='"+$trad('selecionaGeom',i3GEOF.navegapostgis.dicionario)+"'>"+the_geom+"</td><td title='"+$trad('mostraColuna',i3GEOF.navegapostgis.dicionario)+"'>"+mostra+"</td><td>"+nome+"</td></tr>"; |
| 316 | + mostra = "<input onclick='i3GEOF.navegapostgis.geraSql()' style=cursor:pointer type=checkbox name='i3GEOFnavegapostgisMostra' value='*' />"; | ||
| 317 | + ins += "<tr><td></td><td></td><td>"+mostra+"</td><td title='' >Todas</td></tr>"; | ||
| 318 | + | ||
| 316 | for(i=0;i<n;i++){ | 319 | for(i=0;i<n;i++){ |
| 317 | gid = "<input onclick='i3GEOF.navegapostgis.geraSql()' style=cursor:pointer type=radio name='i3GEOFnavegapostgisGid' value='"+retorno[i].field+"' />"; | 320 | gid = "<input onclick='i3GEOF.navegapostgis.geraSql()' style=cursor:pointer type=radio name='i3GEOFnavegapostgisGid' value='"+retorno[i].field+"' />"; |
| 318 | if(retorno[i].type == "line" || retorno[i].type == "polygon" || retorno[i].type == "point" || retorno[i].type == "geometry"){ | 321 | if(retorno[i].type == "line" || retorno[i].type == "polygon" || retorno[i].type == "point" || retorno[i].type == "geometry"){ |
| @@ -359,7 +362,15 @@ i3GEOF.navegapostgis = { | @@ -359,7 +362,15 @@ i3GEOF.navegapostgis = { | ||
| 359 | if(the_geom != ""){ | 362 | if(the_geom != ""){ |
| 360 | colunas.push(the_geom); | 363 | colunas.push(the_geom); |
| 361 | } | 364 | } |
| 362 | - sql = the_geom+" from (select "+colunas.join(",")+" from "+i3GEOF.navegapostgis.esquema+"."+i3GEOF.navegapostgis.tabela+") as foo using unique "+gid+" using srid=4326"; | 365 | + if(colunas[0] === "*"){ |
| 366 | + colunas = ["*"]; | ||
| 367 | + } | ||
| 368 | + if(colunas.length === 1){ | ||
| 369 | + i = colunas[0]; | ||
| 370 | + }else{ | ||
| 371 | + i = colunas.join(","); | ||
| 372 | + } | ||
| 373 | + sql = the_geom+" from (select "+i+" from "+i3GEOF.navegapostgis.esquema+"."+i3GEOF.navegapostgis.tabela+") as foo using unique "+gid+" using srid=4326"; | ||
| 363 | sql = sql.replace(",,",","); | 374 | sql = sql.replace(",,",","); |
| 364 | $i("i3GEOFnavegapostgisSql").value = sql; | 375 | $i("i3GEOFnavegapostgisSql").value = sql; |
| 365 | } | 376 | } |