-
7 Dec 2010 2:49 AM #1
Nested List and nested models ?
Nested List and nested models ?
Hello
I have a question, i want to use a nested list to find details about car parts.
Here are my models :
I can't find the way to set up my treestore for my nested list, actually i don't know wich model i should set in my store.Code:Ext.regModel("Category", { fields: [ 'id_category', 'name' ], hasMany: [ {model: 'Car', name: 'cars'}, ] }); Ext.regModel("Car", { fields: [ 'id_car', 'model' ], hasMany: [ {model: 'Part', name: 'parts'}, ] }); Ext.regModel("Part", { fields: [ 'id_part', 'name', 'price', 'currency', 'picture_url' ] });
Can someone help or tell me what i'm doing wrong ?
Thanks by advance
-
10 Dec 2010 6:29 PM #2Sencha - Community Support Team
- Join Date
- Jan 2009
- Location
- Palo Alto, California
- Posts
- 1,941
- Vote Rating
- 6
This is something we're working on - not supported yet. NestedList currently uses just a single Model.
Ext JS Senior Software Architect
Personal Blog: http://edspencer.net
Twitter: http://twitter.com/edspencer
Github: http://github.com/edspencer
-
12 Dec 2010 11:42 PM #3
A solution would be to use one model and put all the attributes you need into this one model. (Id, name, price, currency, model and picture_url) Nothing says that a record has to use all its attributes.
-
20 Dec 2010 7:39 AM #4
Yes that's what i ended up doing ;-)
Thank you !
-
8 Jul 2011 3:17 PM #5
Is linked models still not supported?
Is linked models still not supported?
I have not seen any examples or mention of linked models with nestedlist. Is this still not supported?
-
8 Jul 2011 3:27 PM #6Sencha - Community Support Team
- Join Date
- Jan 2009
- Location
- Palo Alto, California
- Posts
- 1,941
- Vote Rating
- 6
Not in 1.x, no
Ext JS Senior Software Architect
Personal Blog: http://edspencer.net
Twitter: http://twitter.com/edspencer
Github: http://github.com/edspencer
-
14 Dec 2011 7:11 AM #7
Will this implemented in Touch 2?
I have the same problem as above, whats the best solutions to do this? All fields in one model or use two lists?
After tap an item on the first list showing up the second list with the items from the tapped record?
Edit: This is a litle piece off JSON I have
So the field nr and nm has to be in the first list, after tap shows the items in products. Whats the best way to that...Code:{"success":true, "msg":[{"products":[{"nr":5693,"nm":"Elastiek spoel bind","anm":"","c":"V","pI":{"sut":"Stuk","suts":"ST","p":[{"v":1,"q":1,"uT":"Spoel","uTS":"SL"},{"v":2,"q":12,"uT":"Doos","uTS":"DS"},{"v":3,"q":288,"uT":"Pallet","uTS":"PL"}]}},{"nr":6491,"nm":"Gedemineraliseerd water","anm":"in statiegeld cans","c":"V","pI":{"sut":"Kilogram","suts":"KG","p":[{"v":1,"q":20,"uT":"Can","uTS":"CN"},{"v":2,"q":560,"uT":"Pallet","uTS":"PL"}]}},{"nr":6242,"nm":"Kraan uitloop t.b.v. multibox","anm":"","c":"V","pI":{"sut":"Stuk","suts":"ST","p":[{"v":1,"q":1,"uT":"Stuk","uTS":"ST"},{"v":2,"q":2000,"uT":"Pallet","uTS":"PL"}]}},{"nr":6639,"nm":"Stoomzeil 0.15mu - 9.50 breed","anm":"maatbestelling","c":"V","pI":{"sut":"Vierkante meter","suts":"M2","p":[{"v":3,"q":1000,"uT":"Pallet","uTS":"PL"}]}}],"nr":4,"nm":"Diverse artikelen"},{"products":[{"nr":5465,"nm":"60.28.8 CPP30 HM","anm":"witte doos","c":"V","pI":{"sut":"Stuk","suts":"ST","p":[{"v":1,"q":3000,"uT":"Doos","uTS":"DS"},{"v":2,"q":156000,"uT":"Pallet","uTS":"PL"}]}},{"nr":5119,"nm":"60.28.8 CPP30 WWW","anm":"","c":"V","pI":{"sut":"Stuk","suts":"ST","p":[{"v":1,"q":3000,"uT":"Doos","uTS":"DS"},{"v":2,"q":156000,"uT":"Pallet","uTS":"PL"}]}},{"nr":4979,"nm":"60.30.10 CPP30 HM","anm":"witte doos","c":"V","pI":{"sut":"Stuk","suts":"ST","p":[{"v":1,"q":2500,"uT":"Doos","uTS":"DS"},{"v":2,"q":130000,"uT":"Pallet","uTS":"PL"}]}},{"nr":5052,"nm":"65.32.9 CPP30 HM","anm":"","c":"V","pI":{"sut":"Stuk","suts":"ST","p":[{"v":1,"q":2000,"uT":"Doos","uTS":"DS"},{"v":2,"q":104000,"uT":"Pallet","uTS":"PL"}]}},{"nr":5683,"nm":"65.32.9 CPP30 HM","anm":"150 bnd","c":"V","pI":{"sut":"Stuk","suts":"ST","p":[{"v":1,"q":2100,"uT":"Doos","uTS":"DS"},{"v":2,"q":109200,"uT":"Pallet","uTS":"PL"}]}},{"nr":6318,"nm":"Tape grijs 75mm","anm":"50 m op rol","c":"V","pI":{"sut":"Stuk","suts":"ST","p":[{"v":1,"q":1,"uT":"Stuk","uTS":"ST"},{"v":2,"q":999999,"uT":"Pallet","uTS":"PL"}]}},{"nr":6305,"nm":"Tape grijs 100mm","anm":"","c":"V","pI":{"sut":"Stuk","suts":"ST","p":[{"v":1,"q":1,"uT":"Stuk","uTS":"ST"},{"v":2,"q":999999,"uT":"Pallet","uTS":"PL"}]}}],"nr":6,"nm":"Verpakkingen"}]}
Thanks,
FreezLast edited by JavascriptParrot; 14 Dec 2011 at 7:30 AM. Reason: Added JSON
Similar Threads
-
Display XML data using a List/Nested List
By busybee in forum Sencha Touch 1.x: DiscussionReplies: 16Last Post: 25 Apr 2011, 6:17 AM -
Style a list / nested list as groups
By steilpass in forum Sencha Touch 1.x: DiscussionReplies: 5Last Post: 3 Nov 2010, 2:10 AM -
XTemplate an nested models
By screw in forum Ext GWT: Help & Discussion (1.x)Replies: 4Last Post: 13 Aug 2009, 3:53 AM -
Rendering nested models on a grid
By mathaj77 in forum Ext GWT: DiscussionReplies: 1Last Post: 6 Aug 2009, 4:30 AM -
XTemplate an nested models
By screw in forum Ext 2.x: Help & DiscussionReplies: 6Last Post: 1 Feb 2009, 10:18 AM


Reply With Quote