Results 1 to 3 of 3

Thread: Extjs 6.0.1 treepanel is not loading with data where as it works fine in Extjs 5

  1. #1
    Sencha User
    Join Date
    Dec 2010
    Location
    Pasadena, CA
    Posts
    28
    Answers
    1

    Default Answered: Extjs 6.0.1 treepanel is not loading with data where as it works fine in Extjs 5

    Below is code for Tree Panel, store and it's Model which works fine in Extjs 5.1, I tried same code in Extjs 6, it failed to load the store, with a error message Unable to get value of the property 'getRoot': object is null or undefined
    ext-all-rtl-debug.js?_dc=1455320161150, line 231992 character 9.

    Any guesses, what's wrong i am doing here, I tried moving out root in to Store and and changing Model to Tree Model, did n't helped.Any body mastered treepanel in Extjs 6 can help me out.



    UI code in a panel Item:
    {
    xtype: 'treepanel',
    title: 'Click here to expand the topic tree',
    id: 'westPanelTree',
    preventHeader: true,
    clearOnLoad: true,
    collapsed: false,
    lines: true,
    margin: '4 0 4 4',
    autoScroll: true,
    height: 1800,
    width: 230,
    store: 'TopicTreeStore',
    root: {
    text: "Accounts",
    id: "guide",
    expanded: true
    },
    }

    store is:

    Ext.define('TopicTreeStore', {
    model: 'TopicTreeModel',
    extend: Ext.data.TreeStore,
    storeId: 'myStore',

    proxy: {
    type: 'ajax',
    url: 'abc.json',//Actually some rest call url
    reader: {
    type: 'json'
    }
    },
    autoLoad: true
    });

    Model is:
    Ext.define('TopicTreeModel', {
    extend: Ext.data.Model,
    fields: [
    {
    name: 'text',
    type: 'string'
    },
    {
    name: 'leaf',
    type: 'bool'
    }
    ]
    });

    Thanks
    Ranjay

  2. Hi--

    On your store definition, you have a storeId of "myStore", but in your tree panel, you reference "TopicTreeStore". You should change this to "myStore" (or visa versa):

    https://fiddle.sencha.com/#fiddle/15m0

    Thanks!
    Joel

  3. #2
    Sencha User joel.watson's Avatar
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Hi--

    On your store definition, you have a storeId of "myStore", but in your tree panel, you reference "TopicTreeStore". You should change this to "myStore" (or visa versa):

    https://fiddle.sencha.com/#fiddle/15m0

    Thanks!
    Joel

  4. #3
    Sencha User
    Join Date
    Dec 2010
    Location
    Pasadena, CA
    Posts
    28
    Answers
    1

    Default

    Thanks Joel, good catch, In Extjs 5 classname of Store also get used for reference. So, i was looking 'TopicTreeStore' which is class name.So, I over looked of storeId. Your solution works.

Similar Threads

  1. Drag Source not working with extjs 3.4. Works fine with Extjs 3.0.
    By Pratik_Patel in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 25 Jun 2013, 5:47 AM
  2. Treepanel Listener event does not works ExtJs 4.0.7
    By icebergdelphi in forum Ext: Q&A
    Replies: 5
    Last Post: 30 Nov 2011, 1:36 PM
  3. NEW MDM ZINC 4 supports with Extjs :-) Yeah it works fine...
    By SnakeMedia in forum Community Discussion
    Replies: 1
    Last Post: 21 Oct 2011, 7:26 AM
  4. Replies: 3
    Last Post: 8 Sep 2009, 2:59 AM

Posting Permissions

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