Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8318849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:07:21+00:00 2026-06-08T22:07:21+00:00

I have been unable to make a dynamic tree grid show up as it

  • 0

I have been unable to make a dynamic tree grid show up as it should – the data behind the grid is working and I can see the result being printed to the FireBug Console. Yet none of it is showing in the ExtJS Tree Grid, none except the Root node which has been statically set in the store.

The view:

Ext.define('TS.view.file.archives.raGrid', {
    extend: 'Ext.tree.Panel',
    alias: 'widget.ramaingridpanel',

    id: 'raGrid',
    autoScroll: true,
    store: 'file.archives.Resources',
    layout: {
        type: 'hbox',
        align: 'top',
        pack: 'start'
    },
    columns: [{
        xtype: 'treecolumn',
        id: 'raGridResourceName',
        flex: 2,
        dataIndex: 'text',
        width: 100,
        hideable: false,
        groupable: false,
        text: 'Name',
        editor: {
            xtype: 'textfield'
        }
    }, {
        xtype: 'templatecolumn',
        id: 'raGridResourceIcon',
        tpl: new Ext.XTemplate('<div id="{iconCls}" class="{iconCls}" role="presentation">&nbsp;</div>').html,
        flex: 0.1,
        dataIndex: 'iconCls',
        hideable: false,
        groupable: false,
        editor: {
            xtype: 'combobox',
            store: Ext.data.StoreManager.lookup('file.archive.ResourceIcons')
        }
    }, {
        xtype: 'datecolumn',
        id: 'raGridDate',
        flex: 1,
        dataIndex: 'updated',
        hideable: false,
        groupable: false,
        text: 'Updated'
    }, {
        xtype: 'gridcolumn',
        id: 'raGridPurchasingUnit',
        flex: 1,
        dataIndex: 'purchasedUnit',
        groupable: false,
        text: 'Unit',
        editor: {
            xtype: 'textfield'
        }
    }, {
        xtype: 'numbercolumn',
        id: 'raGridCost',
        flex: 1,
        dataIndex: 'purchasedCost',
        groupable: false,
        text: 'Cost excl. VAT',
        editor: {
            xtype: 'textfield'
        }
    }, {
        xtype: 'numbercolumn',
        id: 'raGridDiscount',
        dataIndex: 'purchasedDiscount',
        flex: 1,
        groupable: false,
        text: 'Discount %',
        editor: {
            xtype: 'textfield'
        }
    }, {
        xtype: 'gridcolumn',
        id: 'raGridEstimatingUnit',
        flex: 1,
        dataIndex: 'estimateUnit',
        groupable: false,
        text: 'Unit',
        editor: {
            xtype: 'textfield'
        }
    }, {
        xtype: 'numbercolumn',
        id: 'raGridAddOn',
        flex: 1,
        dataIndex: 'profitAddOn',
        groupable: false,
        text: 'Mark-up %',
        editor: {
            xtype: 'textfield'
        }
    }, {
        xtype: 'numbercolumn',
        id: 'raGridLanded',
        flex: 1,
        dataIndex: 'landedCost',
        groupable: false,
        text: 'Landed cost',
        editor: {
            xtype: 'textfield'
        }
    }, {
        xtype: 'numbercolumn',
        id: 'raGridCostPrice',
        flex: 1,
        dataIndex: 'number',
        groupable: false,
        text: 'Costprice',
        editor: {
            xtype: 'textfield'
        }
    }, {
        xtype: 'numbercolumn',
        id: 'raGridUnitCorrelation',
        flex: 1,
        dataIndex: 'unitCorrelation',
        groupable: false,
        text: 'Prch./Est.',
        editor: {
            xtype: 'textfield'
        }
    }, {
        xtype: 'numbercolumn',
        id: 'raLeadTime',
        flex: 1,
        dataIndex: 'leadTime',
        groupable: false,
        text: 'Leadtime',
        editor: {
            xtype: 'textfield'
        }
    }, {
        xtype: 'gridcolumn',
        id: 'raGridClass',
        flex: 1,
        dataIndex: 'ResourceClassShortname',
        groupable: false,
        text: 'Class',
        editor: {
            xtype: 'textfield'
        }
    }, {
        xtype: 'gridcolumn',
        id: 'raGridSupplier',
        flex: 1,
        dataIndex: 'supplierName',
        groupable: false,
        text: 'Supplier',
        editor: {
            xtype: 'textfield'
        }
    }],
    viewConfig: {
        id: 'raGridView'
    },
    plugins: [{
        ptype: 'rowediting',
        autoCancel: false,
        clicksToEdit: 2
    }, {
        ptype: 'gridviewdragdrop',
        ddGroup: 'raDdGroup'
    }]
});

The store:

Ext.define('TS.store.file.archives.Resources', {
    extend: 'Ext.data.TreeStore',
    alias: 'store.file.archives.Resources',

    model: 'TS.model.file.archives.Resources',
    autoLoad: false,
    proxy: {
        type: 'ajax',
        url: 'index.php/ajax/resources/',
        reader: {
            type: 'json',
            root: 'results',
            successProperty: 'success',
            totalProperty: 'total'
        }
    },
    root: {
        text: 'Resources',
        id: 'myResources',
        expanded: true,
        children: {}
    }
});

The model:

Ext.define('TS.model.file.archives.Resources', {
extend : 'Ext.data.Model',
alias : 'model.file.archives.Resources',

fields : [ {
    name : 'id',
    type : 'int'
}, {
    name : 'parent_id',
    type : 'int'
}, {
    name : 'child_id',
    type : 'int'
}, {
    name : 'text',
    type : 'string'
}, {
    name : 'updated',
    type : 'date'
}, {
    name : 'purchasedUnit',
    type : 'string'
}, {
    name : 'purchasedCost',
    type : 'double'
}, {
    name : 'purchasedDiscount',
    type : 'double'
}, {
    name : 'estimateUnit',
    type : 'string'
}, {
    name : 'profitAddOn',
    type : 'string'
}, {
    name : 'addonManager',
    type : 'string'
}, {
    name : 'landedCost',
    type : 'double'
}, {
    name : 'unitCorrelation',
    type : 'double'
}, {
    name : 'leadTime',
    type : 'string'
}, {
    name : 'ResourceClassShortname',
    type : 'string'
}, {
    name : 'supplierName',
    type : 'string'
}, {
    name : 'iconCls',
    type : 'string'
}, {
    name : 'ClientSessionId',
    type : 'string'
} ]
});

The JSON data:

({
    "success":"true", 
    "total":"1", 
    "results":
    [{
        "id":0,
        "parent_id":0,
        "child_id":2,
        "text":"Gravemaskiner",
        "updated":1339079129,
        "purchasedUnit":"",
        "purchasedCost":0,
        "purchasedDiscount":0,
        "estimateUnit":"",
        "profitAddOn":"",
        "landedCost":0,
        "unitCorrelation":0,
        "leadTime":"",
        "ResourceClassShortname":"",
        "supplierName":"",
        "iconCls":"iconFolder",
        "leaf":false,
        "children":...

If anyone would be so kind an point out what’s wrong with my code that would be great,

G.

Using ExtJS 4.0.7


Update: 2012-06-19

Been testing a lot and this error seems to have something to do with it, but I’m not sure what it means and how to solve it:

records[i] is undefined
/extjs/ext-all-dev.js Line 88068

Have printed the objects to console and they clearly show the data in the store.


  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T22:07:22+00:00Added an answer on June 8, 2026 at 10:07 pm

    Sencha support replied the following:

    The reason the tree is not loading correctly is because the json invalid for the tree to digest.

    The problem was in the JSON – how it was generated:

    // I used this:
    $result[$i] = $newArray;
    
    // To fix I had to use this to generate the JSON
    array_push($result,$newArray);
    

    And:

    I did notice on your original json, that it was wrapped in “( )” which is incorrect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been unable to make a successful connection to my SQL Server (2005)
I have been unable to figure out this problem - it just doesn't make
I have been unable to make a definitive choice and was hoping that somebody
I have been unable to find any documentation on the .build method in Rails
I have been unable to find any decent documentation on this function. The code
I have been unable to find any documentation on properly closing database connections in
I have been unable to locate any information on compatibility with Visual Studio 2003
I have been researching intently and have been unable to find a solution to
I have need to return multiple results from a subquery and have been unable
After an extensive search I have been unable to find any information on this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.