-
14 Jul 2012 12:12 PM #1
rejectChanges - Ext.data.TreeStore
rejectChanges - Ext.data.TreeStore
Hello,
i would like to ask you if anyone found way how to reject changes in treestore when you get exception on sync(). I already checked this forum but found information bout rejectChanges on Ext.data.Store only. So i wanted override Ext.data.treestore add rejectChanges function but i found one big problem.
As you know property removed collecting all removed nodes with relations except relation to parent node in store. Basically you can rebuild tree from array removed but you dont have information bout relation to parent node or previous/nextSibling so you dont know where to this rebuilded tree put.
Is this bug or can i read these information somewhere in structure?
-
15 Jul 2012 2:29 AM #2
I think i found the problem? Function remove on node will call removeChild function with params: this, destroy, suppressEvents (NodeInterface.js: 844). Destroy tell us, if the node will be destroyed upon removal or not. Function removeChild on line 650-654 has condition:
So when i follow the code we need to know what does clear function do.Code:if (destroy) { node.destroy(true); } else { node.clear(); }
So how it looks, problem is in clear function. After we call this function, any references will be removed. So after that call you will loose all informations to reject changes.Code:... /** * Clears the node. * @private * @param {Boolean} [destroy=false] True to destroy the node. */ clear : function(destroy) { var me = this; // clear any references from the node me.parentNode = me.previousSibling = me.nextSibling = null; if (destroy) { me.firstChild = me.lastChild = null; } }, ...
Anybody from Sencha can confirm this problem?
-
16 Jul 2012 7:51 AM #3Sencha - Community Support Team
- Join Date
- Nov 2007
- Location
- Helsingborg, Sweden
- Posts
- 2,454
- Vote Rating
- 48
+1, would be nice with a solution to this issue.
-
16 Jul 2012 2:15 PM #4
This has been submitted: EXTJSIV-6804
Regards,
Scott.
-
2 Nov 2012 10:48 AM #5
Hello,
I have the same problem (no rejectChanges method for TreeStore).
Could you tell me more about the solution?
Where can I find this EXTJSIV-6804?
When I get an exception how to restore the node that the user wanted to remove or delete the node that the user wanted to add?
-
2 Nov 2012 10:57 AM #6
This is an internal ID for our bug tracking software. At this time, it is slated for our 4.2 release (no public date).
We do not provide public access to our tracking software at this time.
Scott.
-
27 Feb 2013 12:43 AM #7
Ext JS 4.2.0 RC 1 (4.2.0.489)
Ext JS 4.2.0 RC 1 (4.2.0.489)
I have not found rejectChanges for Ext.data.TreeStore in RC 1. Will it be in RC 2 or later?


Reply With Quote