Commit 01905776fbf348574dabeb615399305f25fa93e4

Authored by Edmar Moretti
1 parent c8e40800

Ordenação da lista de valores no utilitario que gera um combo de valores

classesjs/classe_util.js
@@ -1874,16 +1874,20 @@ i3GEO.util = @@ -1874,16 +1874,20 @@ i3GEO.util =
1874 $i(onde).innerHTML = "<span style=color:red;font-size:10px; >buscando valores...</span>"; 1874 $i(onde).innerHTML = "<span style=color:red;font-size:10px; >buscando valores...</span>";
1875 } 1875 }
1876 var monta = function(retorno) { 1876 var monta = function(retorno) {
1877 - var ins = [], i, pares, j; 1877 + var ins = [], i, pares, j, valoresSort = [];
1878 if (retorno.data !== undefined) { 1878 if (retorno.data !== undefined) {
1879 ins.push("<select id=" + id + " >"); 1879 ins.push("<select id=" + id + " >");
1880 ins.push("<option value='' >---</option>"); 1880 ins.push("<option value='' >---</option>");
1881 for (i = 0; i < retorno.data[1].registros.length; i++) { 1881 for (i = 0; i < retorno.data[1].registros.length; i++) {
1882 pares = retorno.data[1].registros[i].valores; 1882 pares = retorno.data[1].registros[i].valores;
1883 for (j = 0; j < pares.length; j++) { 1883 for (j = 0; j < pares.length; j++) {
1884 - ins.push("<option value='" + pares[j].valor + "' >" + pares[j].valor + "</option>"); 1884 + valoresSort.push(pares[j].valor);
1885 } 1885 }
1886 } 1886 }
  1887 + valoresSort.sort();
  1888 + for (j = 0; j < valoresSort.length; j++) {
  1889 + ins.push('<option value="' + valoresSort[j] + '" >' + valoresSort[j] + '</option>');
  1890 + }
1887 ins.push("</select>"); 1891 ins.push("</select>");
1888 ins = ins.join(''); 1892 ins = ins.join('');
1889 temp = { 1893 temp = {
ferramentas/selecao/index.js
@@ -1013,7 +1013,6 @@ i3GEOF.selecao = { @@ -1013,7 +1013,6 @@ i3GEOF.selecao = {
1013 interrogacao.onclick = function(){ 1013 interrogacao.onclick = function(){
1014 var obj = (this.parentNode.parentNode.getElementsByTagName("input"))[0], 1014 var obj = (this.parentNode.parentNode.getElementsByTagName("input"))[0],
1015 itemTema = (this.parentNode.parentNode.getElementsByTagName("select"))[0].value; 1015 itemTema = (this.parentNode.parentNode.getElementsByTagName("select"))[0].value;
1016 - //FIXME ordenar a lista de valores e remover apostrofe  
1017 i3GEO.util.comboValoresItem( 1016 i3GEO.util.comboValoresItem(
1018 "i3GEOselecaocbitens", 1017 "i3GEOselecaocbitens",
1019 i3GEO.temaAtivo, 1018 i3GEO.temaAtivo,