1. #1
    Sencha Premium Member
    Join Date
    Nov 2008
    Posts
    58
    Vote Rating
    0
    mishoboss is on a distinguished road

      0  

    Default Unanswered: Update a memory type proxy store with new data?

    Unanswered: Update a memory type proxy store with new data?


    Hi, I have a local variable with JSON data which I modify realtime. I load this variable as data in a NestedList component via store.

    This is the variable:
    Code:
    var UInavPanel = {text:'My nav',items:[{text:'item1'},{text:'item2'}]};
    This is my TreeStore:
    Code:
    var leftPanelstore = new Ext.data.TreeStore({
        model: 'LeftPanelListItem',
        root: UInavPanel,
        //autoSync:true,
        autoLoad: true,
        proxy: {
            type: 'memory',
            reader: {
                type: 'json',
                root: 'items'
            }
        }
    });
    This builds the NestedList with only the initial data, it doens'update it when a change in UInavPanel happens. How could be this done? I need when I modify the JSON data in UInavPanel, the nestedlist to rebuilds itself with the new data.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,408
    Answers
    3549
    Vote Rating
    851
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Have you tried using loadData to load new data into the Store?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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.

  3. #3
    Sencha Premium Member
    Join Date
    Nov 2008
    Posts
    58
    Vote Rating
    0
    mishoboss is on a distinguished road

      0  

    Default


    Yes, I've tried, but it seems TreeStore doesn't have loadData method.

  4. #4
    Sencha Premium Member
    Join Date
    Nov 2008
    Posts
    58
    Vote Rating
    0
    mishoboss is on a distinguished road

      0  

    Default


    Any other suggestion?

  5. #5
    Sencha Premium Member
    Join Date
    Nov 2008
    Posts
    58
    Vote Rating
    0
    mishoboss is on a distinguished road

      0  

    Default


    I solved it, but the solution seems dirty. The TreeStore has a method setRootNode(). I use it to load the changed object.

Thread Participants: 1