-
2 Nov 2007 11:45 PM #21
OK, You've done well so far, but it's not advisable to use dots in field names (and the therefor the ColumnModel dataIndex properties that reference them) because the dataIndex is used as a javascript property name, and dots are significant - there's another thread posted today where someone got bitten just just this: http://extjs.com/forum/showthread.php?t=17046
What you need to do is define a mapping in field definition configs for the fields that are pulled from within an inner property.
The documentation for Ext.data.record.create explains this.Code:var electronicDevice = Ext.data.Record.create([ { name : 'id'}, // property name within the row object is the same as the field name { name : 'model', mapping: 'properties.model'}, // mapping needed here because name != mapping { name : 'deviceType', mapping: 'properties.deviceType'}, { name : 'netBandWidth', mapping: 'properties.netBandwidth'} ]); var reader = new Ext.data.JsonReader({ root : "features", totalProperty : "total", id : "id" }, electronicDevice); var store = new Ext.data.Store({ nocache : true, reader : reader, autoLoad : true, remoteSort : true, proxy : new Ext.data.HttpProxy({ url : '/getjson?queryable=featureType&featureType=Electronic%20Device', method : 'GET' }) }); var grid1 = new xg.GridPanel({ ds: store, cm: new xg.ColumnModel([ {id : 'id', header : "Feature Number", width: 8, dataIndex : 'id'}, {header: "Model", width: 10, dataIndex: 'model'}, {header: "Device Type", width: 10, dataIndex: 'deviceType'}, {header: "Net Bandwidth", width: 10, dataIndex: 'netBandwidth'} ...
-
3 Nov 2007 6:11 AM #22
OK, thanks. I had read the part about 'mapping' in the docs, but didn't grasp it until you explained it. Thanks for the advice.
And to mjlecomte: The thread says it all. Read it carefully, especially the part about 'nested' objects and using the proper 'root'. I supplied a working example in my final code post and Animal provided another useful suggestion. Cobnet and JoeK provided useful info that got me further along. The previous examples were lacking just a bit in dealing with 'nested' objects in JSON. Looking back, I probably should have provided my code in the very first post.
-
10 Jan 2008 9:35 PM #23
Didn't work in Firefox but worked in IE 6
Didn't work in Firefox but worked in IE 6
-
11 Jan 2008 12:42 AM #24
Well you're in luck. Firefox has a good debugger. You can use ext-all-debug.js, and set a break in JsonReader.readRecords() and step through and find out exactly what is happening.
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
-
14 Jan 2008 7:40 PM #25
Yes, I was lucky! Problem solved! Thanks Animal!
-
3 Feb 2010 12:23 PM #26
tryandls and animal
tryandls and animal
TryanDLS and Animal, why are you guys being so mean to him? He just wanted some help on a question, there's no need to be so terrible to him.

-
22 Oct 2010 7:39 AM #27
God, this thread makes me sick. What better way to turn away new and potential developers than for a product's "Community Support Team" to belittle its newest community members. There is a time and place for RTFM, but save the heckling for community members who aren't paid staff or volunteers vested in the success of the framework.
My initial impression of Ext and the Sencha Touch framework is that it is pretty good, but lacking in documentation (think proxy on jsonstore/jsonpstore) at times and a little too "beta" for us to purchase a commercial license... not to mention threads like these which, quite frankly, makes me want to avoid using Sencha forums to seek help with my Sencha-related questions.
-
16 Aug 2012 10:45 AM #28
why are you not using the root you specified in the proxy?
------------------------------------------
Conor Armstrong
tw: @evathedog
web: rockstown.com
Ext.ux.form.AutoCombo
Ext.ux.SimpleIFrame
Ext.ux.form.ToolFieldSet
Knowledge is realising that the street is one-way, wisdom is looking both directions anyway.
-
20 Aug 2012 5:59 PM #29
Just for the record: I deleted a long reply because the original ... shall I call it "incident"? Anyhow, it was long ago.
Just to say I was disappointed by the tone, and the indulgence.
Water under the bridge; bigger fish to fry.If you look to see how the system works
Likely you will find that it doesn't.


Reply With Quote



