ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: queensgambit9 on June 19, 2019, 03:56:55 pm
-
Would it be possible to disable context menu option based on cell value?
Option should be disabled and no action performed when clicked.
Using:
function bodyItems(evt, ui){
return [
{
name: "test",
disabled: false,
action: function(evt, ui){
// do something
}
}
]}
-
Yes, cell value can be found from ui.rowData[ui.dataIndx]
var val = ui.rowData[ui.dataIndx]
and context menu item can be disabled based on cell value
function bodyItems(evt, ui){
var val = ui.rowData[ui.dataIndx], disabled = ( 1 < val < 10);
return [
{
name: "test",
disabled: disabled,
action: disabled? null: function(evt, ui){
// do something
}
}
]}