EasyUI Forum
June 16, 2024, 07:57:42 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: help me please. can we use combogrid filter more than one in on page  (Read 10972 times)
rishal
Newbie
*
Posts: 5


View Profile
« 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 ..
Logged
rolin
Newbie
*
Posts: 3


View Profile Email
« Reply #1 on: July 22, 2012, 07:26:46 PM »

maksud detailnya gimana ya?
Logged
rishal
Newbie
*
Posts: 5


View Profile
« Reply #2 on: July 27, 2012, 09:05:06 PM »

  Smiley  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.
Logged
heru
Newbie
*
Posts: 12


View Profile
« Reply #3 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');
}
« Last Edit: July 29, 2012, 08:54:53 PM by heru » Logged
rishal
Newbie
*
Posts: 5


View Profile
« Reply #4 on: August 10, 2012, 02:37:04 PM »

Ok. Terima kasih
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!