EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: aswzen on April 27, 2015, 11:34:25 PM



Title: How to end edit all row at once?
Post by: aswzen on April 27, 2015, 11:34:25 PM
How to end edit all row at once? for example 3 of my rows were edited and of course its editable, now i want to end all of it, how can i do that? should i loop for every rows?

For example, I have 2 editable datagrid, and every row can be edited without end edit, now i want to end all editable rows in both datagrid by single click of a button, how i can do that? its possible to end all of editable rows in many datagrid by select it class? because i don't want to loop all datagrid .

Thank You in advance

fiddle :
http://jsfiddle.net/aswzen/2Leprrso/1/


Title: Re: How to end edit all row at once?
Post by: jdx100424 on April 29, 2015, 02:16:24 AM
var rows = $('#XX').datagrid('getRows');
for ( var i = 0; i < rows.length; i++) {
   $('#XX').datagrid('endEdit', i);
}