ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: gammax500 on November 19, 2015, 07:46:31 pm
-
I just upgraded to v 3.2.0 in order to use new checkbox attributes, however now my grid has broken. When changes are made to data, save buttons no longer enable.
This code enables/disables header row buttons to submit or rollback changes:
history: function (evt, ui) {
var $grid = $(this);
if (ui.canUndo != null) {
$("button.changes", $grid).button("option", { disabled: !ui.canUndo });
}
if (ui.canRedo != null) {
$("button:contains('Redo')", $grid).button("option", "disabled", !ui.canRedo);
}
$("button:contains('Undo')", $grid).button("option", { label: 'Undo (' + ui.num_undo + ')' });
$("button:contains('Redo')", $grid).button("option", { label: 'Redo (' + ui.num_redo + ')' });
},
-
It is due to change in context of callbacks and events.
http://paramquery.com/pro/upgrade/index
1. Context of general and event based callbacks has been changed from DOM reference to widget instance.
So the below
var $grid = $(this);
can be replaced with
var $grid = this.widget();
Example: http://paramquery.com/pro/demos/editing_batch
-
Thank you! That did the trick.