Results 1 to 2 of 2

Thread: How to reload the nestedlist...?

  1. #1
    Sencha User
    Join Date
    Sep 2011
    Location
    India
    Posts
    56
    Vote Rating
    0
      0  

    Default Unanswered: How to reload the nestedlist...?

    Initially i have a nested list with some value
    Eg: TreeStore= new Ext.data.TreeStore({ model: 'treestore',
    root:{text: 'Groceries',items: [{text: 'Drinks',items: [{text: 'Water',items: [{text: 'Sparkling',leaf: true},{text: 'Still',leaf: true}]
    },{text: 'Coffee',leaf: true},{text: 'Espresso',leaf: true},{text: 'Redbull',leaf: true
    },{text: 'Coke',leaf: true},{text: 'Diet Coke',leaf: true}]},{text: 'Empty Category',
    items: []}]};,

    storeId:'root',
    autoLoad:true,
    autoSave:true,
    proxy: { type: 'memory', reader: { type: 'tree', root: 'items' } },
    }
    });

    .. i have the changed the values in nested list with extra values added to root...
    Change the values in nested list like this
    TreeStore.root = {text: 'Groceries',items: [{text: 'Drinks',items: [{text: 'Water',items: [{text: 'Sparkling',leaf: true},{
    text: 'Still',leaf: true}]},{text: 'Coffee',leaf: true
    },{text: 'Espresso',leaf: true},{text: 'Redbull',leaf: true
    },{text: 'Coke',leaf: true},{text: 'Diet Coke',leaf: true}]
    },{text: 'Empty Category',items: []}]};

    Is it correct way do for changing the values in tree store?
    but t s not reflecting in UI... Hw can i get the changed values in UI (nested list)
    i ve tried with doLayout() for the nestedlist is not working...

    My Nested List is Here:

    NestedList = new Ext.NestedList({
    flex:1,
    cls:'nestedlist',
    title:'Lists',
    width:'10%',
    height:'100%',
    id:'nestedlist',
    cardSwitchAnimation: 'fade',
    backText: "Back",
    useTitleAsBackText: false,
    toolbar: {
    cls:'nestedlisttoolbar',
    items: [
    {xtype: 'spacer'}]
    },
    store: TreeStore,
    getDetailCard: function(recordNode, parentNode) {
    console.log(recordNode);
    console.log(parentNode);
    return new Ext.Panel({
    title: 'Details about ' + recordNode.text,
    html: recordNode.text + ' is great'
    });
    }


    });

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,339
    Answers
    3887
    Vote Rating
    1297
      0  

    Default

    Each item of NestedList is a list and each list has it's own store. So if the list is already shown it's store is then disconnected to the TreeStore.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •