From 389106120f97798221d7d911477793d34976f984 Mon Sep 17 00:00:00 2001 From: edmarmoretti Date: Fri, 8 Jul 2016 16:02:45 -0300 Subject: [PATCH] Inclusão de filtro na página de cadastro de operações --- admin1/dicionario/core.js | 4 ++-- admin1/usuarios/operacoes/index.js | 23 +++++++++++++++++++---- admin1/usuarios/operacoes/index.php | 25 ++++++++++--------------- init/index.js | 2 +- 4 files changed, 32 insertions(+), 22 deletions(-) diff --git a/admin1/dicionario/core.js b/admin1/dicionario/core.js index ff3c95c..a07d902 100755 --- a/admin1/dicionario/core.js +++ b/admin1/dicionario/core.js @@ -351,8 +351,8 @@ i3GEOadmin.core.dicionario = { en : "", es : "" } ], - '' : [ { - pt : "", + 'filtro' : [ { + pt : "Filtro", en : "", es : "" } ], diff --git a/admin1/usuarios/operacoes/index.js b/admin1/usuarios/operacoes/index.js index c77304c..40b6e4e 100755 --- a/admin1/usuarios/operacoes/index.js +++ b/admin1/usuarios/operacoes/index.js @@ -88,13 +88,13 @@ function pegaOperacoes(){ } ); ondeListaOperacoes.html(html); - //indice + //filtro html = Mustache.to_html( - "{{#data}}" + $("#indiceTpl").html() + "{{/data}}", + "{{#data}}" + $("#templateFiltro").html() + "{{/data}}", {"data":json["operacoes"]} ); - //indice lateral - $("#indice").html(html); + $("#filtro").html("" + html); + //monta um template para o modal de inclusao de nova operacao html = Mustache.to_html( $("#templateOperacoes").html(), @@ -220,3 +220,18 @@ function salvarOperacao(id_operacao){ } ); } +function filtra(obj,id){ + $("#" + id + " .panel").each( + function(i,el){ + if(obj.value == ""){ + $(el).show(); + } + else { + $(el).hide(); + } + } + ); + if(obj.value != ""){ + $("#"+obj.value).show(); + } +} diff --git a/admin1/usuarios/operacoes/index.php b/admin1/usuarios/operacoes/index.php index 52c02ce..cd6aa86 100755 --- a/admin1/usuarios/operacoes/index.php +++ b/admin1/usuarios/operacoes/index.php @@ -16,7 +16,7 @@ include "../../head.php";
-
+
- - -
- -