Results 1 to 4 of 4

Thread: Error updating tree panel data

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    3

    Default Error updating tree panel data

    I have two tables in the database: Devices and Groups. Groups can contain devices and/or sub-groups. Both tables basically have id, name and groupId (parentId) columns.

    On the front-end I have two corresponding stores, but I also want to display the hierarchy in tree panel. To achieve this, in the tree panel I have memory store and in view controller I subscribe to update events on Devices and Groups stores. On every update I combine data from two stores into an array of nodes, and then ask store to reload data from proxy:

    Code:
    store.getProxy().setData(nodes);
    store.load();
    Everything works fine until I decided to implement filtering in my tree panel. If any field is updated on filtered data, I get error like this:

    Ext.data.TreeStore.treeify(): Ext.data.TreeStore, Invalid parentId "g4"
    where parentId is basically groupId and "g4" is the id of a group. I get this error even I don't filter out any groups.

    Does anyone have an idea why it can be happening and how to fix it?

    Also, maybe there is a better way to combine two flat stores into a tree store?

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Have you compared the working data with the filtered data?

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    3

    Default

    Quote Originally Posted by Gary Schlosberg View Post
    Have you compared the working data with the filtered data?
    Data is re-loaded when I try to update a record, so the data is different, but all ids are the same and tree hierarchy is the same.

  4. #4
    Sencha Premium User dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,246
    Answers
    26

    Default

    Chasing the same issue:

    Code:
    store.getProxy().setData(nodes);
    store.load();
    Seems devs only coded a numeric use case...

    Quote Originally Posted by tananaev View Post
    Data is re-loaded when I try to update a record, so the data is different, but all ids are the same and tree hierarchy is the same.

    I guess it doesn't help when the source is coded:

    Code:
    //<debug>
    if (!nodeMap[parentId]) {
        Ext.raise('Ext.data.TreeStore, Invalid parentId "' + parentId + '"');
        }
        //</debug>
    Cloud Application Architect

    Sencha Specialist / Sencha MVP / Sencha Technical Trainer
    ExtJs Developer + Contributor since 0.2.2 - Champion of the per developer license.

Similar Threads

  1. Replies: 1
    Last Post: 11 Dec 2013, 11:23 AM
  2. [OPEN] DataView Error When Updating Store Data on Controller Launch
    By lgreenway in forum Sencha Touch 2.x: Bugs
    Replies: 2
    Last Post: 21 Mar 2013, 12:35 AM
  3. Tooltip Not Updating in Tree Panel
    By adavis2 in forum Ext: Q&A
    Replies: 2
    Last Post: 11 Sep 2012, 6:30 AM
  4. Live updating a tree that loads data asynchronously
    By smares in forum Ext: Discussion
    Replies: 1
    Last Post: 11 Aug 2011, 10:55 PM

Posting Permissions

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