|
Jeffrey AnnSheila
|
 |
« Reply #2 on: June 05, 2016, 11:01:57 PM » |
|
HOW TO GET THE NESTED SUBGRID?
I try your code in my page, and modify it like this: <table id="dg"></table> <div id="toolbar" hidden="hidden"> <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="javascript:$('#dg').edatagrid('destroyRow')">new</a> <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="javascript:$('#dg').edatagrid('destroyRow')">delete</a> <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-save" plain="true" onclick="javascript:$('#dg').edatagrid('saveRow')">save</a> <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-undo" plain="true" onclick="javascript:$('#dg').edatagrid('cancelRow')">cancel</a> </div> var conf = { options:{ //...omit the property setting codes here url:"xxxxxxxx", saveUrl:"xxxxxxxx", destroyUrl:"xxxxxxxx", updateUrl:"xxxxxxxx", edatagrid:true, autoUpdateDetail:false, columns:[[......]], subgrid:{ options:{ rownumbers:true, striped:true, fitColumns:false, nowrap:false, fixed:true, idField:'id', foreignField:'id', url:"xxxxxxxx", saveUrl:"xxxxxxxx", destroyUrl:"xxxxxxxx", updateUrl:"xxxxxxxx", edatagrid:true, autoUpdateDetail:false, toolbar:[{ iconCls: 'icon-add', handler: function(){
//HERE IS THE PROBLEM, HOW TO GET THE NESTED SUBGRID? THE "index" IS UNDEFINED.
var ddv = $(this).datagrid('getRowDetail',index).find('table.ddv'); ddv.datagrid('appendRow'); }} }], columns:[[......]], ..................................... $(function(){ $('#dg').datagrid('subgrid', conf);})
I got the firefox debug message :TypeError: $.data(...) is undefined, when the code is running. HOW TO GET THE NESTED SUBGRID?
|