Store的提交和回滚类似于数据库中的commit、rollback,当客户端修改了一条Record的属性之后,这条Record记录和后台数据库中的实际数据就不一致了,此时的Record对象就成了"脏数据"
commitChanges() : void
Commit all Records with
outstanding changes. To handle updates for changes, subscribe to the Store's
update event, and perform updating when the third parameter is Ext.data.Record.COMMIT.
Parameters:
- None.
- void
rejectChanges() : void
上面是将Store中的所有记录都进行提交或回滚,而有时我们只需要回滚或提交某条记录,就会使用到Ext.data.Record的
commit( [Boolean silent] ) : void
Usually called by the
Ext.data.Store which owns the Record. Commits all changes made to the Record since either creation, or the last commit operation.
Developers should subscribe to the Ext.data.Store.update event to have their code notified of commit operations.
Parameters:
-
silent
: Boolean(optional) True to skip notification of the owning store of the change (defaults to false)
- void
reject( [Boolean silent] ) : void
Usually called by the
Ext.data.Store which owns the Record. Rejects all changes made to the Record since either creation, or the last commit operation. Modified fields are reverted to their original values.
Developers should subscribe to the Ext.data.Store.update event to have their code notified of reject operations.
Parameters:
-
silent
: Boolean(optional) True to skip notification of the owning store of the change (defaults to false)
- void