<link rel="stylesheet" href="http://extjs.cachefly.net/ext-4.0.2a/resources/css/ext-all.css">
Check this for more details:<br/>
<a href='http://atechiediary.blogspot.com/2013/06/extjs-how-to-create-static-and-dynamic.html'> Detail Blog entry </a>
<br/>
<br/>
JavaScript
Ext.define('Car', {
extend: 'Ext.data.Model',
fields: [{
name: 'name',
type: 'string'
}],
proxy: {
type: 'memory',
data: {
success: true,
children: [{
name: 'Cars',
leaf: false, // this is a branch
expanded: false,
children: [{
name: 'Mercedes-Benz',
leaf: true // this is a leaf node. It can't have children. Sad! :-(
}, {
name: 'Audi',
leaf: true
}, {
name: 'Ferrari',
leaf: true
}]
}]
}
}
});
var store = Ext.create('Ext.data.TreeStore', {
model: 'Car'
});
Ext.create('Ext.tree.Panel', {
title: 'Car Simple Tree',
width: 200,
height: 150,
store: store,
rootVisible: false,
lines: true, // will show lines to display hierarchy.
useArrows: false, // switched off for comparison
renderTo: Ext.getBody(),
columns: [{
xtype: 'treecolumn',
dataIndex: 'name', // value field which will be displayed on screen
flex: 1
}]
});
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.