Hi,
We have posted a new build that extended ClientSideBeginEdit and ClientSideEndEdit from CustomColumn only to all GridColumns. A new sample has also been added to Grid -> Features -> Client Side Validation to demonstrate this feature. You can use this new feature to perform validations when user leaves the cell.
Note you will be able to validate/change the cell value inside your handler, but the handler does not give you the ability to keep the cell in edit mode. We did not provide such support through ClientSideEndEdit because our experience indicates most users find unable to leave edit mode to be annoying. If you do wish to keep user in edit mode, you can call the following function to put the cell back to edit mode:
http://doc.essentialobjects.com/library/1/jsdoc.public.grid.editcell.aspxThe code will be something like this:
Code: JavaScript
function endedit_handler(cell, newValue)
{
//Check whether your new value is invalid using
//whatever logic
if (new_value_is_invalid(newValue))
{
//You can display a message at here indicating
//that the user has entered an invalid value
window.setTimeout(
function()
{
//Get the grid object
var grid = cell.getGrid();
//Put the cell back to edit mode
grid.editCell(cell.getItemIndex(), cell.getColIndex);
}, 10);
}
}
Note the code uses setTimeout to call editCell instead of calling it directly. This is necessary to allow the cell to finish the current flow first and then enter edit mode again.
Please see your private message for the download location of the new build. Hope this helps.
Thanks!