I copied the button binding to the detail grid and modified the class names to make sure I am refereeing to the detail buttons.
I copied the function for add, edit, update and delete and renamed them to editRowDetail for example. I now need to refer to the detail grid so I can set it to edit mode etc.
In this function in the demo you have
function editRowDetail(rowIndx) {
$grid.pqGrid("addClass", { rowIndx: rowIndx, cls: 'pq-row-edit' });
$grid.pqGrid("editFirstCellInRow", { rowIndx: rowIndx });
How do I refer to the detail grid here instead of the main grid.
Also in the demo you have
init: function (ui) {
var rowData = ui.rowData,
id = rowData["ID"];
//make a deep copy of gridDetailModel
var objCopy = $.extend(true, {}, gridDetail);
objCopy.dataModel.url = "/" + id;
objCopy.dataModel.error = function () {
$gridMain.pqGrid("rowInvalidate", {rowData:rowData});
};
var $grid = $("<div></div>").pqGrid(objCopy);
return $grid;
}
Later on in my code I reference the main grid like this
var $grid = $("#jsongrid").pqGrid(gridMain);
I tried to refer to the detail grid using objCopy but that doesn't work.