Posted 9 October 2017, 3:22 am EST
Hi,
I would like some advice on using flexgrid.cellEditEnding.addHandler in combination with a custom editor.
I have written a custom editor by following this example: https://www.grapecity.com/en/blogs/custom-editors-in-flexgrid/
I have also added a cellEditEnding handler:
flexgrid.cellEditEnding.addHandler (function (s, e) {
var flex = s,
oldVal = flex.getCellData(e.row, e.col),
newVal = flex.activeEditor.value;
console.log("cellEditEnding row: " + e.row + " col: " + e.col)
console.log("old: ", oldVal, " new: ", newVal)
})
This may conflict with the custom editor pattern (referenced above) as it also registers a cellEditEnding handler:
var editEndingEH = function (s, args) {
grid.cellEditEnding.removeHandler(editEndingEH);
if (!args.cancel) {
args.cancel = true;
grid.setCellData(e.row, e.col, input.value);
}
};
// subscribe the handler to the cellEditEnding event
grid.cellEditEnding.addHandler(editEndingEH);
});
This ends up showing the same value for old and new. Am I doing something wrong?
How can I use a custom editor and show the old value, new value when cellEditEnding is done.
Thanks, Daryn