Results 1 to 5 of 5

Thread: Loading extjs tree nodes data on demand

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Loading extjs tree nodes data on demand

    Hi,

    I am a newbee to Ext js.I am using extjs 4.0 version. Below is my extjs-treegrid.js.

    I would like to know, how could I achieve on demand load of data whenever the child nodes are clicked.
    Basically, I want to load only configurable records from json file to my tree grid and on click of the any of the childnodes(or any node) I want to load all the records from the same/different json file. I mean asyncronous load.

    An extjs java script example will be much helpful/any examples we have at sencha.
    Kindly help.

    Code:
    Ext.onReady(function() {
     Ext.define('MyModel', {
          extend: 'Ext.data.Model',
          fields: fdata // this variable holds all the fields
      });
        var store = Ext.create('Ext.data.TreeStore', {
            model: 'MyModel',
            proxy: {
                type: 'ajax',
                url: 'myJson.json'
            } ,
            autoload:false,
            folderSort: true
        });
        var grid = Ext.create('Ext.tree.Panel', {
            store: store,
            height: 400,
            width: 970,
            renderTo: 'divarea',
            expanded: true,
            useArrows: false,
            rootVisible: false,
            loadMask: true,
      columns: coldata//this variable holds all the columns correctly mapped with dataIndex
        });
    });

    Thanks,
    Ashu
    Last edited by mitchellsimoens; 20 Mar 2012 at 9:36 AM. Reason: added [CODE] tags

Posting Permissions

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