-
16 Jan 2012 10:48 AM #11
They getKey of the MixedCollection is just an injected function which returns this.internalId
So the key is how the internalId of the Record is set.
Look for this code in the reader:"
And see if you can step into there in the Readers you are testing.Code:extractData : function(root) { var me = this, records = [], Model = me.model, length = root.length, clientIdProp = Model.prototype.clientIdProperty, fields = me.getFields(), fieldLength = fields.length, convertedValue, convertedValues, field, name, node, id, record, i, j, value; if (!root.length && Ext.isObject(root)) { root = [root]; length = 1; } for (i = 0; i < length; i++) { node = root[i]; id = me.getId(node); // Create a record with an empty data object. // Populate that data object by extracting and converting field values from raw data record = new Model(undefined, id, node, convertedValues = {});Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
16 Jan 2012 11:41 AM #12
The line in the extractData method of Ext.data.reader.Reader
id = me.getId(node);
is in fact returning the correct numbers, in my case (1,2,5) so the problem must be occurring higher up the tree, I will being going up the stack and try and locate it.
-
16 Jan 2012 1:28 PM #13
Ok I'v located the problem code, however I have no idea what it's purpose is.
I forgot to include the a portion of the data being returned.... sorry about that.
Inside of the Readers extractData method there is this code
My data set returned has 2 ids, a projectId and a clientId (1 client many projects). initially the internalId is set correctly based on the idProperty value however once it passes over that code, it sees that there is also a 'clientId'?? property on the node and then updates it to that... Which happens to be the same for each of my models being returned because I'm returning a list of data associated with a client...Code:if (node[clientIdProp]) { record.internalId = node[clientIdProp]; }
Removing that property from the json data being returned fixes the issue.
-
17 Jan 2012 9:08 AM #14
It seems like this property is used internally to track batch changes in the writer. However this seems like a fairly common field name, is there any chance you can rename it to something a little more obscure?
-
19 Jan 2012 4:10 AM #15
That would be a good idea. I have transferred this ticket to the engineer who implemented the clientId property. We will come up with a fix for 4.1.0 final.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
7 Mar 2012 2:44 AM #16
Ah, excellent!
Skirtle sent me here for a look... glad to see it's being picked up!
I hit the issue and reported it in the beta forum, but didn't get much traction...
For what it's worth, my base model sets the clientIdProperty to 'phantomId', since I believe that's what it's intended for?
Cheers,
WestyProduct Architect
Altus Ltd.
-
16 Mar 2012 2:51 AM #17
This is fixed post-RC1 (just now merged). The clientIdProperty will default to null.
Don Griffin
Ext JS Development Team Lead
Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue
"Use the source, Luke!"
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJSIV-5103
in
4.1.


Reply With Quote