EasyUI Forum
June 23, 2018, 12:55:25 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: datagrid get change bug  (Read 278 times)
bakoma
Newbie
*
Posts: 13


View Profile Email
« on: May 15, 2018, 12:54:05 PM »

Suppose you have an editable datagrid with id="dg"
you get changes this way
all changes:
var changes = $('#dg').datagrid('getChanges');
all inserts:
var c = $('#dg').datagrid('getChanges', 'inserted');
all updates:
var u = $('#dg').datagrid('getChanges', 'updated');
all deletes:
var d = $('#dg').datagrid('getChanges', 'deleted');

supposedly changes=c+u+d, but this is not always true unfortunately.

get the bug this way:
you first edit this row (say myRow)
and then delete this row

then you would think:
c=[]
u=[]
d=[{myRow}]

actually
c=[]
u=[{myRow}]             <------------problem--------------
d=[{myRow}]
Logged
Pierre
Sr. Member
****
Posts: 399


View Profile Email
« Reply #1 on: May 16, 2018, 07:21:59 AM »

You can create simple example using online editor, like
http://code.reloado.com/oeasyrik1/2/edit#source
(this is just example, you can put your own code there).
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!