1. #1
    Ext User
    Join Date
    Dec 2010
    Posts
    4
    Vote Rating
    0
    shrell is on a distinguished road

      0  

    Default 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 :
    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'
    			]
    		});
    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.
    Can someone help or tell me what i'm doing wrong ?
    Thanks by advance

  2. #2
    Sencha User edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    9
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    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

  3. #3
    Sencha User
    Join Date
    Aug 2010
    Location
    Europa
    Posts
    216
    Vote Rating
    1
    kortovos is on a distinguished road

      0  

    Default


    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.

  4. #4
    Ext User
    Join Date
    Dec 2010
    Posts
    4
    Vote Rating
    0
    shrell is on a distinguished road

      0  

    Default


    Yes that's what i ended up doing ;-)
    Thank you !

  5. #5
    Sencha User
    Join Date
    Jul 2011
    Posts
    2
    Vote Rating
    0
    vishr is on a distinguished road

      0  

    Default 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?

  6. #6
    Sencha User edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    9
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    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

  7. #7
    Touch Premium Member
    Join Date
    Nov 2011
    Posts
    125
    Vote Rating
    0
    JavascriptParrot is on a distinguished road

      0  

    Question


    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

    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"}]}
    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...

    Thanks,
    Freez
    Last edited by JavascriptParrot; 14 Dec 2011 at 7:30 AM. Reason: Added JSON

Similar Threads

  1. Display XML data using a List/Nested List
    By busybee in forum Sencha Touch 1.x: Discussion
    Replies: 16
    Last Post: 25 Apr 2011, 6:17 AM
  2. Style a list / nested list as groups
    By steilpass in forum Sencha Touch 1.x: Discussion
    Replies: 5
    Last Post: 3 Nov 2010, 2:10 AM
  3. XTemplate an nested models
    By screw in forum Ext GWT: Help & Discussion (1.x)
    Replies: 4
    Last Post: 13 Aug 2009, 3:53 AM
  4. Rendering nested models on a grid
    By mathaj77 in forum Ext GWT: Discussion
    Replies: 1
    Last Post: 6 Aug 2009, 4:30 AM
  5. XTemplate an nested models
    By screw in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 1 Feb 2009, 10:18 AM

Thread Participants: 4