EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: wymak on May 20, 2016, 09:23:30 AM



Title: subgrid toolbar
Post by: wymak on May 20, 2016, 09:23:30 AM
I have created a grid, with subgrid  as follow (it is more or less the same as the example code)
The problem is: How can I add a toolbar to this sub-grid? Thx

Code:
$(function(){


$('#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: "gettxprog.php?patno=901001&txnum=" + row.txnum,
//url:'datagrid22_getdetail.php?itemid='+row.itemid,
fitColumns:true,
singleSelect:true,
rownumbers:true,
loadMsg:'',
height:'auto',
columns:[[
{field:"txdate", title:'Date', width:30},  
{field:"descp", title:'Detail', width:80},  
{field:"stage", title:'Stage', width:20},  
{field:"payway", title:'Pay Method', width:20},  
{field:"paid", title:'Paid', width:20},  
{field:"dr", title:'Dr', width:20}  
]],
onResize:function(){
$('#dg').datagrid('fixDetailRowHeight',index);
},
onLoadSuccess:function(){
setTimeout(function(){
$('#dg').datagrid('fixDetailRowHeight',index);
},0);
}
});
$('#dg').datagrid('fixDetailRowHeight',index);
}
});



Title: Re: subgrid toolbar
Post by: stworthy on May 21, 2016, 02:28:39 AM
You can set the 'toolbar' property to setup the datagrid toolbar. Please look at this example http://www.jeasyui.com/demo/main/index.php?plugin=DataGrid&theme=default&dir=ltr&pitem=DataGrid%20with%20Toolbar


Title: Re: subgrid toolbar
Post by: aswzen on March 27, 2017, 10:17:24 AM
You can set the 'toolbar' property to setup the datagrid toolbar. Please look at this example http://www.jeasyui.com/demo/main/index.php?plugin=DataGrid&theme=default&dir=ltr&pitem=DataGrid%20with%20Toolbar

How to style the toolbar wrapper css if its created on javascript?