×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: AUREO SOUTO
Added: Dec 4, 2018 2:00 PM
Views: 3561
Tags: no tags
  1.  
  2. <!--MODAL -->                  
  3. <?php
  4.                 Modal::begin([ 
  5.                         'header'=>'<h4>Dados Pessoa Física</h4>',
  6.                         'id'=>'modalPessoaFisica',
  7.                         'size'=>'modal-lg',
  8.                         'options' => [
  9.                                 // 'tabindex' => false
  10.                         ],
  11.                 ]);
  12.         echo "<div id='modalContentPessoaFisica'></div>";
  13.                 Modal::end();
  14.  
  15.  
  16.                
  17.         Modal::begin([
  18.                         'header'=>'<h4>Dados Pessoa Jurídica</h4>',
  19.                         'id'=>'modalPessoaJuridica',
  20.                         'options' => [
  21.                         //      'tabindex' => false // important for Select2 to work properly
  22.                         ],
  23.                         'size'=>'modal-lg'
  24.             ]);
  25.                 echo "<div id='modalContentPessoaJuridica'></div>";
  26.                 Modal::end();
  27.        
  28.  
  29.                 Modal::begin([
  30.                         'header'=>'<h4>Endereço</h4>',
  31.                         'id'=>'modalEnderecoFornecedor',
  32.                         'options' => [
  33.                                 //'tabindex' => false
  34.                         ],
  35.                         'size'=>'modal-lg'
  36.             ]);
  37.                 echo "<div id='modalContentEnderecoFornecedor'></div>";
  38.                 Modal::end();
  39.          
  40.         ?>
  41.        
  42. <?php
  43. $this->registerJs(<<<JS
  44.  
  45.  
  46.             $(function(){
  47.                     $('#modalBtnPessoaFisica').click(function(){
  48.                                     $('#modalPessoaFisica').modal('show')
  49.                                             .find('#modalContentPessoaFisica')
  50.                                             .load($(this).attr('value'));
  51.                     });
  52.             });
  53.  
  54.  
  55.             $(function(){
  56.                     $('#modalBtnPessoaJuridica').click(function(){
  57.                                     $('#modalPessoaJuridica').modal('show')
  58.                                             .find('#modalContentPessoaJuridica')
  59.                                             .load($(this).attr('value'));
  60.                     });
  61.             });
  62.  
  63.  
  64.                  $(function(){
  65.                     $('#modalBtnEnderecoFornecedor').click(function(){
  66.                                     $('#modalEnderecoFornecedor').modal('show')
  67.                                             .find('#modalContentEnderecoFornecedor')
  68.                                             .load($(this).attr('value'));
  69.                     });
  70.             });
  71.  
  72. JS
  73. );
  74. ?>