I'm struggling to find a way to retrieve if any cell has really been modified through batch editing.
I'd like to show the SAVE CHANGES and CANCEL CHANGES buttons, only if some editing really took place.
I already found to show/hide a button inside a toolbar in the Command Item template but I'm struggling to know if is there any cell that have been modified (when the little red triangle in the corner appear).
I went down to the ._changes object but with no much luck since the object is empty at start but if you modify a cell and then revert it back to initial value, the ._changes object is no more empty even if no red triangles appear and no batch editing happened after all.
Here is what I come up with so far (but it doesn't work for the reason above):
How can I spot if there are any red marks on the grid? (because this is what I'm looking for to show/hide the UPDATE and CANCEL buttons in real time)
I'd like to show the SAVE CHANGES and CANCEL CHANGES buttons, only if some editing really took place.
I already found to show/hide a button inside a toolbar in the Command Item template but I'm struggling to know if is there any cell that have been modified (when the little red triangle in the corner appear).
I went down to the ._changes object but with no much luck since the object is empty at start but if you modify a cell and then revert it back to initial value, the ._changes object is no more empty even if no red triangles appear and no batch editing happened after all.
Here is what I come up with so far (but it doesn't work for the reason above):
function
ShowBatchUpdateButton() {
var
toolBar = $find(
"RadToolBar1"
);
var
button = toolBar.findItemByText(
"Nuovo"
);
var
grid = $find(
"<% = RadGrid1.ClientID %>"
);
if
(!jQuery.isEmptyObject(grid.get_batchEditingManager()._changes)) {
button.set_cssClass(
"ShowGridCommandBarButton"
)
}
else
{
button.set_cssClass(
""
)
}
}
How can I spot if there are any red marks on the grid? (because this is what I'm looking for to show/hide the UPDATE and CANCEL buttons in real time)