Hello,
I noticed on your samples that when a row is in edition in the grid and we click on the footer or the header the modification are cancelled and the row is not editing anymore. Is that a normal behavior because when we click outside of the grid the editing row stay editing and we can't update the row until we click on done, cancel or on another row.
Another thing I would know is ther is a way to update the row when the user click outside the grid ? It'a a behavior I would have.
Regards.
Hi,
Is anyone can help me please ?
Hi everybody,
May I have a response please ?
Hello Maya,
Indeed it works ! Thank you very much for your help.
Best regards.
Hello Cosoluce_Stones ,
The child grids are separate instances of igGrid widgets. In order to invoke a method for the specific widget’s updating feature you need to get the specific widget that’s the owner of the editCellStarting event and invoke the method for it. For example:
editCellStarting: function (evt, ui)
{
ui.editor.off('focusout');
ui.editor.on('focusout', function ()
console.log("In the 'editCellStarting' of the sub level");
ui.owner.endEdit(true);
});
},
You can view the documentation on the editCellStarting event here:
https://www.igniteui.com/help/api/2013.2/ui.iggridupdating#events
Let me know if you have any questions.
Best Regards,
Maya Kirova
Developer Support Engineer II
Infragistics, Inc.
www.infragistics.com/support
Hi Maya,
Did you find a solution for my issue ?
Indeed I tried your sample on a grid and it works, but I'm using a hierarchicalGrid and I have a problem :
The code you wrote in the '$(document).click' function, I moved it on the 'focusout' of the editor in the 'editCellStarting' and it works fine in the first level.
But when I do it on a sub level, it doesn't work.
I attached a sample.
Thank you for posting in our forum.
By default when you click outside the grid the row will not be closed. You can manually force the end of the editing and save the changes by calling the endEdit method. You could for example handle the document’s click event and if the element clicked is outside the grid you can manually close and save the change using the endEdit method:
$(document).click(function (e) {
if (e.srcElement.parentElement == null) {
$("#grid1").igGridUpdating("endEdit", true);
}
If you want the changes to also be saved when you click somewhere inside the grid (anywhere except on the Cancel button) you could do something like this
editRowEnding: function (evt, ui) {
if ($(evt.currentTarget).text() != "Cancel") {
ui.keepEditing = true;
setTimeout('$("#grid1").igGridUpdating("endEdit", true);', 10);
That will force the grid to keep editing so it won’t reject the changes automatically and it would the manually force it to close after a small timeout and save the change.
I’ve attached a sample for your reference.Let me know if you’re aiming to achieve something similar.
http://ko.infragistics.com/support