EasyUI Forum
March 29, 2024, 12:13:01 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: subgrid with filter  (Read 3394 times)
netterbizz
Newbie
*
Posts: 3


View Profile Email
« on: March 16, 2017, 06:34:21 AM »

please help me, how to add filter date to subgrid with the following code :

           $('#dg').datagrid({
                view: detailview,
                detailFormatter:function(index,row){
                    return '<div style="padding:2px"><table class="ddv"></table></div>';
                },
                onExpandRow: function(index,row){
                    var ddv = $(this).datagrid('getRowDetail',index).find('table.ddv');
                    ddv.datagrid({
                  url:'lap-pegawai-data-det.php?filternip='+row.nip,
                        fitColumns:false,
                        singleSelect:true,
                        rownumbers:true,
                        loadMsg:'Tunggu Sebentar',
                        height:'auto',
                        columns:[[
                     {field:'tanggal',title:'Tanggal',width:120,align:'center'},
                     {field:'keterangan',title:'Keterangan Absensi',width:400,align:'left'}
                        ]],
                        onResize:function(){
                            $('#dg').datagrid('fixDetailRowHeight',index);
                        },
                        onLoadSuccess:function(){
                            setTimeout(function(){
                                $('#dg').datagrid('fixDetailRowHeight',index);
                            },0);
                        }
                    });
                    $('#dg').datagrid('fixDetailRowHeight',index);
                }
            });

best regards and thank you
Logged
jarry
Administrator
Hero Member
*****
Posts: 2260


View Profile Email
« Reply #1 on: March 16, 2017, 06:45:43 AM »

Please describe your question in more detail.
Logged
netterbizz
Newbie
*
Posts: 3


View Profile Email
« Reply #2 on: March 16, 2017, 07:02:42 AM »

please help me, how to add filter date to subgrid with the following code :

           $('#dg').datagrid({
                view: detailview,
                detailFormatter:function(index,row){
                    return '<div style="padding:2px"><table class="ddv"></table></div>';
                },
                onExpandRow: function(index,row){
                    var ddv = $(this).datagrid('getRowDetail',index).find('table.ddv');
                    ddv.datagrid({
                  url:'lap-pegawai-data-det.php?filternip='+row.nip,
                        fitColumns:false,
                        singleSelect:true,
                        rownumbers:true,
                        loadMsg:'Tunggu Sebentar',
                        height:'auto',
                        columns:[[
                     {field:'tanggal',title:'Tanggal',width:120,align:'center'},
                     {field:'keterangan',title:'Keterangan Absensi',width:400,align:'left'}
                        ]],
                        onResize:function(){
                            $('#dg').datagrid('fixDetailRowHeight',index);
                        },
                        onLoadSuccess:function(){
                            setTimeout(function(){
                                $('#dg').datagrid('fixDetailRowHeight',index);
                            },0);
                        }
                    });
                    $('#dg').datagrid('fixDetailRowHeight',index);
                }
            });

best regards and thank you

in this code will show all data (all date) in subgrid with same nip at parentgrid

url:'lap-pegawai-data-det.php?filternip='+row.nip,

i want add date filter or other criteria to limit data in datebase that will shown in subgrid
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!