EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: rishal on July 11, 2012, 06:37:24 AM



Title: help me please. can we use combogrid filter more than one in on page
Post by: rishal on July 11, 2012, 06:37:24 AM
<script type='text/javascript'>
   $(function(){
         $('#cg').combogrid({
                  panelWidth:350,
         url: 'popsupplier.php',
         idField:'kode',
         textField:'kode',
         mode:'remote',
         fitColumns:true,
   columns:[[
{field:'kode',title:'KODE',align:'left',width:5},
{field:'nama',title:'SUPPLIER',align:'left',width:20}
]]
   });
   $(input[name='mode']).change(function(){
            var mode = $(this).val();
            $('#cg').combogrid({
               mode: mode
            });
         });
      });



   $(function(){
         $('#cc').combogrid({
                  panelWidth:350,
         url: 'popkode.php',
         idField:'kodeobat',
         textField:'kodeobat',
         mode:'remote',
         fitColumns:true,
   columns:[[
{field:'kode',title:'KODE',align:'left',width:5},
{field:'nama',title:'NAMA OBAT',align:'left',width:20}
]]
   });
   $(input[name='mode']).change(function(){
            var mode = $(this).val();
            $('#cc').combogrid({
               mode: mode
            });
         });
      });


   </script>

thanks for your help ..


Title: Re: help me please. can we use combogrid filter more than one in on page
Post by: rolin on July 22, 2012, 07:26:46 PM
maksud detailnya gimana ya?


Title: Re: help me please. can we use combogrid filter more than one in on page
Post by: rishal on July 27, 2012, 09:05:06 PM
  :)  kalau kita buat combo grid lebih dari satu di suatu form isian misal: ada pilihan kode dan nama supplier. terus di bawnhya kita ada pilihan lagi gunain combo box untuk pilih nama nama kode obat dan nama  obat. walaupun dengan beda nama ID tag nya.


Title: Re: help me please. can we use combogrid filter more than one in on page
Post by: heru on July 29, 2012, 08:21:45 PM
halo rishal,

tidak masalah anda gunakan lebih dari 1 combogrid filter dalam satu form.
 $(function(){

function initObat(suplierId){
      $('#cc').combogrid({
         ........
         url: 'popkode.php?supplierId=' + supplierId,
         ......
      });
      $('#cc').combogrid('enable');
}

 $('#cg').combogrid({
         .........,
          url: 'popsupplier.php',
         /** jika mau filter kode obat berdasar supplier, gunakan saja event onSelect */
         onSelect:function(row){
            var supplierId = $('#cg').combogrid('getValue');
            initObat(supplierId);
           
         }

   });

  // Jika diperlukan, disable dulu combogrid kode obat sebelum kode supplier di pilih
  $('#cc').combogrid('disabled');
}


Title: Re: help me please. can we use combogrid filter more than one in on page
Post by: rishal on August 10, 2012, 02:37:04 PM
Ok. Terima kasih