ashu111.techie
20 Mar 2012, 6:40 AM
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.
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
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.
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