Advertisement
jeffersonvv

Ocultando e Mostrando Opções no ComboBox 2.0

Sep 9th, 2015
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. o.validarOpcoesFormulaCalculo = function (codi_trib) {
  2.  
  3.     o.cx.find('#formula_calculo_tax').children('option').css('display', 'none');
  4.     o.cx.find('#formula_calculo_tax').children('option[value=""]').css('display', '');
  5.     o.cx.find('#formula_calculo_tax').children('option[value="0"]').css('display', '');
  6.     o.cx.find('#formula_calculo_tax').val('');
  7.  
  8.     var opts = [];
  9.     switch (codi_trib) {
  10.         case <?=\Tributos\Tributos\Enum\TributosPadrao::IPTU ?>:
  11.             opts = [1, 2, 3, 4, 5, 10, 15, 16, 17, 18, 19, 20, 21, 22, 24, 25];
  12.             break;
  13.         case <?=\Tributos\Tributos\Enum\TributosPadrao::ISSQN?>:
  14.             opts = [6, 7, 8];
  15.             break;
  16.         case <?=\Tributos\Tributos\Enum\TributosPadrao::DIVIDA_ATIVA?>:
  17.             opts = [9];
  18.             break;
  19.         case <?=\Tributos\Tributos\Enum\TributosPadrao::ITBI?>:
  20.             opts = [11];
  21.             break;
  22.         case <?=\Tributos\Tributos\Enum\TributosPadrao::AGUA_E_OU_ESGOTO?>:
  23.             opts = [14, 23];
  24.             break;
  25.     }
  26.  
  27.     $.each(opts, function (i, v) {
  28.         console.log(v);
  29.         o.cx.find('#formula_calculo_tax').children('option[value="' + v + '"]').css('display', '');
  30.     });
  31. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement