ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: Aleutian on May 11, 2023, 05:10:28 pm
-
I have created a nested grid and am attempting to add a cellClick event. I have added the code, but it only works on the main grid, not the nested.
detailModel: {
//cache: false,
collapseIcon: "ui-icon-plus",
expandIcon: "ui-icon-minus",
init: function (ui) {
var rowData = ui.rowData,
detailobj = gridDetailModel($(this).pqGrid('instance'), rowData), //get a copy of gridDetailModel
$grid = $("<div></div>").pqGrid(detailobj); //init the detail grid.
$grid.on ( "cellClick", function( event, ui ) {} );
return $grid;
}
I have also attempted to add a cellClick in the gridDetailModel function, but it also only works on the main grid.
-
Please correct it to
$grid = $("<div></div>").pqGrid(detailobj), //init the detail grid.
grid = $grid.pqGrid('instance');
grid.on('cellClick', function(evt, ui){
alert('cellClick');
});
return $grid;
Alternatively you can also add cellClick event callback to gridDetailModel
-
Perfect, thanks.