Problem: master grid has onSelectRow event and it displays detail grid correctly. Detail grid has onclickSubmit event to update key field from master grid row. When I click add on bottom navigation of detail grid and save detail data it saved data but freezes the detail grid. Even just press the add button and cancel it without save it freezes the grid.
After that if you select any row in Master .. detail grid shows 'Loading' and it did not shows any detail rows until you refresh the page and not clicked the add / edit button.
I checked the Responed message of AZAX and its returning all data even in DOM it creates columns but without data.
Please help.
Here is the code
</td></tr></tbody></table><div id="subjecttopicpage"></div><table id="subjecttopic"></table><td align="right"></td><div id="subjectFormpage"></div><table id="subjectForm"></table><table><tbody><tr><td>
<script src="jquery.js" type="text/javascript"></script>
<script src="jquery-ui-1.8.21.custom.min.js" type="text/javascript"></script>
<script src="jqgrid/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="jqgrid/jquery.jqGrid.min.js" type="text/javascript"></script>
<script type="text/javascript">
var jq=jQuery.noConflict();
var subjectFormgrid =
jq("#subjectForm").jqGrid({
url:eduajaxurl+'&task=getdetail&config=subject',
datatype: "json",
colNames:['id','Subject','Enable',''],
colModel:[
{name:'id',index:'id', hidden: true , editable: true, editrules: {edithidden:true}},
{name:'subject',index:'subject asc', width:200, editable:true},
{name:'published',sortable:false, width:60, editable:true,align:'center',formatter:'checkbox',edittype:"checkbox"},
{name: 'myac', width:45, fixed:true, sortable:false, resize:false, formatter:'actions',formatoptions:{keys:true}}
],
rowNum:10,
rowList:[10,20,30],
pager: '#subjectFormpage',
sortname: 'subject',
sortorder: "asc",
viewrecords: true,
caption:"Subject Details",
editurl:eduajaxurl+'&task=saveconfig&config=subject',
autowidth:true,
multiselect: false,
onSelectRow: function(ids) {
if(ids == null) {
ids=0;
if(subjecttopicFormgrid.jqGrid('getGridParam','records') >0 )
{
subjecttopicFormgrid.jqGrid('setGridParam',{url:eduajaxurl+"&task=getdetail&config=subjecttopic&subid="+ids,page:1});
subjecttopicFormgrid.jqGrid('setCaption',"Topic Detail: "+ids);
subjecttopicFormgrid.trigger('reloadGrid');
}
} else {
subjecttopicFormgrid.jqGrid('setGridParam',{url:eduajaxurl+"&task=getdetail&config=subjecttopic&subid="+ids,page:1});
subjecttopicFormgrid.jqGrid('setCaption',"Subject Topics: "+ids);
subjecttopicFormgrid.trigger('reloadGrid');
}
}
});
jq("#subjectForm").jqGrid('navGrid','#subjectFormpage',{edit:false,add:true,del:false});
var subjecttopicFormgrid =
jq("#subjecttopic").jqGrid({
url:eduajaxurl+"&task=getdetail&config=subjecttopic&subid=2″,
datatype: "json",
colNames:['id','subid','Topic','Enable',''],
colModel:[
{name:'id',index:'id', hidden: true , editable: true, editrules: {edithidden:false}},
{name:'subid',index:'subid', hidden: true , editable: true, editrules: {edithidden:false}},
{name:'subjecttopic',index:'subjecttopic asc', width:200, editable:true},
{name:'published',sortable:false, width:60, editable:true,align:'center',formatter:'checkbox',edittype:"checkbox"},
{name: 'myac', width:45, fixed:true, sortable:false, resize:false, formatter:'actions',formatoptions:{keys:true}}
],
rowNum:10,
rowList:[10,20,30],
pager: '#subjecttopicpage',
sortname: 'subjecttopic',
sortorder: "asc",
viewrecords: true,
caption:"Subject Topics",
editurl:eduajaxurl+'&task=saveconfig&config=subjecttopic',
autowidth:true,
multiselect: false
});
subjecttopicFormgrid.jqGrid('navGrid','#subjecttopicpage',{add:true,edit:false,del:false},
{},
{onclickSubmit: function(rp_ge, postdata) {
var parentid = subjectFormgrid.getGridParam('selrow');
postdata.subid = parentid;
}}
);
}
</script>