How to use "e" parameter of endEdit method? Documentation says:
.igGridUpdating( "endEdit", [update:bool], [e:object] );
Hello Luis,
This particular event is provided to end the row editing manually (when the row is putted in edit mode). In order to handle the event which is raised after that method you can handle editCellEnded/Ending or editRowEnded/Endind depends if you are using cell or row editing type.
Thanks Kolev, I understand what the method (not event) does but not how to use its parameter "e", could you bring an example of how to use it? what are the benefits of that parameter? I think there is a lack of information in this regard in the documentation, maybe I am wrong. Thanks again ;)
Hello,
Yes, your assumption is correct, you can pass myObject to the event handler argument and access it later in editCellEnded event (which will be fired because you are passing true like a second parameter).
Code snippet:
<script> var data = [ { "ID": 1, "Name": "John Smith", "Age": 45 }, { "ID": 2, "Name": "Mary Johnson", "Age": 32 }, { "ID": 3, "Name": "Bob Ferguson", "Age": 32 }, ];
$(function () { $("#grid").igGrid({ primaryKey: "ID", dataSource: data, //JSON Array defined above features: [ { name: "Updating", enableAddRow: true, editMode: "cell", enableDeleteRow: false, enableAddRow: false, editCellEnded: function(evt, ui){ alert("editCellEnded");
//evt.originalEvent will return you the object } } ] }); }); function StartEdit() { $("#grid").igGridUpdating("startEdit", 1, 1); } function EndEdit() { var car = { type:"VW Golf", model: 4, color: "silver"}; $("#grid").igGridUpdating("endEdit", true, car); } </script>
Let me know if I may be of further assistance.
Thank you so much Kolev!!! now is crystal clear to me :) This is the kind of documentation I need it.
I am glad to hear that you find my reply helpful.
Thank you for using our products.
this example the event editCellEnded does not fire when working with new row