Hi,
I have created the following sample based on the downloaded package from the sight. it's all fine but rightclick event is not getting fired
Please check line: $("#grid_table").on( "pqgridrowrightclick", function( event, ui ) {alert();} );
$("#grid_table").pqGrid({
rowRightClick: function( event, ui ) {
//alert(ui.rowIndx);
//alert(ui.rowIndxPage);
var data = ui.dataModel.data[ui.rowIndx];
alert("Rank is: "+data[0]);
}
});
function changeToGrid(that) {
var tbl = $("table.fortune500");
var obj = $.paramquery.tableToArray(tbl);
var newObj = { width: 700, height: 400, numberCell: false, title: "Grid From Table", resizable: false, editable:false };
newObj.dataModel = { data: obj.data, rPP: 20, paging: "local" };
newObj.colModel = obj.colModel;
var columns = [
{ title: "Rank", width: 100, dataIndx: "0", hidden: true },
{ title: "Company", width: 130, dataIndx: "1" },
{ title: "Revenues ($ millions)", width: 190, dataIndx: "2" },
{ title: "Profits ($ millions)", width: 100, dataIndx: "3", align: "right" },
{ title: "Links", width: 100, dataIndx: "4", align: "right" },
];
newObj.colModel = columns;
newObj.dataModel = { data: obj.data, rPP: 20, paging: "local"};
$("#grid_table").pqGrid(newObj);
$("#grid_table").pqGrid({
rowClick: function( event, ui ) {
//alert(ui.rowIndx);
//alert(ui.rowIndxPage);
var data = ui.dataModel.data[ui.rowIndx];
alert("Rank is: "+data[0]);
}
});
$("#grid_table").on( "pqgridrowrightclick", function( event, ui ) {alert();} );
$(that).val("Change Grid back to Table");
tbl.css("display", "none");
}
Thanks and Regards,
Ridwan