I am using this link from Oleg and Demo to create context menu. Is there a way to pass some dynamic values to each row apart from rowId. May be one way is to set hidden values for each row and get those hidden column values but not sure how to implement this functionality. Thanks for any help or suggestions..
loadComplete: function(data) {
// Fix the Grid Width...
fixGridWidth($("#grid"));
// Context Menu
$("tr.jqgrow", this).contextMenu('contextMenu', {
bindings: {
'abc1': function(trigger) {
// would like to pass some custom values
},
'abc2': function(trigger) {
// open a link in new window using a hyperlink
},
'abc3': function(trigger) {
// custom logic
}
},
onContextMenu : function(event, menu) {
//var rowId = $(event.target).parent("tr").attr("id");
//var grid = $("#grid");
//grid.setSelection(rowId);
//return true;
}
});
You can use
trigger
parameter which hasid
initialized as the rowid. So you can usegetCell
orgetRowData
. For example theabc1
method can be like the followingsee here one more demo which uses
menuStyle
anditemHoverStyle
which improve a little the visibility of the context menu. The demo is from the bug request which I recently posted.