I have a datagrid with subgrid.
It's along the lines of
http://www.jeasyui.com/tutorial/datagrid/datagrid22.php With a parent record row expanded, upon double-clicking a child record, a modal form is opened and when submitted, it saves, and reloads the parent datagrid.
I want it to re-select the parent record and expand the parent record.
Everything works fine except it will not expand the record.
Here's my code. I get the parent id from the form, and from that get the rowIndex.
I understand the method is:
$('#dg').datagrid('expandRow', rowIndex);
function updateRecordTask() {
var _thisjobid = $('#idtaskformjob_id').combogrid('getValue');// GET job_id (parent record id) from Form
$('#taskfm').form('submit', {
url: url,
onSubmit: function() {
return $(this).form('validate');
},
success: function(result) {
var result = eval('(' + result + ')');
if (result.success) {
$.messager.show({
title: 'Success!',
msg: result.msg
});
$('#taskdlg').dialog('close'); // close the dialog
$('#dg').datagrid('reload'); // reload the user data
$('#dg').datagrid('selectRecord', _thisjobid); //Select parent record with job_id
var _rowid = $('#dg').datagrid('getRowIndex',_thisjobid); //Get rowindex of parent record with job_id
$('#dg').datagrid('expandRow',_rowid); //NOT WORKING - Expand row with rowindex
} else {
$.messager.show({
title: 'Error',
msg: result.msg
});
}
}
});
}
Everything works except the expandRow method....
Any ideas why it won't expand the row?
Thanks