hot to get value of parent from the click of child value.
Please do give me suggestion
Here is my code....
Ext.onReady(function () {
Ext.define('Person', {
extend: 'Ext.data.Model',
fields: [
{ name: 'value', type: 'int',defaultValue :null },
{ name: 'year', type: 'string' },
{ name: 'sla', type: 'string' },
{ name: 'vendor', type: 'string' },
],
});
var store = Ext.create('Ext.data.TreeStore', {
model: 'Person',
root: {
text: 'Root',
expanded: true,
children: [
{
sla: 'Effort',
children: [
{
sla: 'Effort',
vendor:'TCS',
children: [
{
vendor:'TCS',
year:'2013',
value:'99',
leaf: true
},
{
vendor:'TCS',
year:'2014',
value:'100',
leaf: true
}
]
},
{
sla: 'Effort',
vendor:'HCL',
children: [
{
vendor:'HCL',
year:'2013',
value:'99',
leaf: true
},
{
vendor:'HCL',
year:'2014',
value:'100',
leaf: true
}
]
}
]
},
{
sla: 'Variance',
children: [
{
sla: 'Variance',
vendor:'TCS',
children: [
{
vendor:'TCS',
year:'2013',
value:'95',
leaf: true
},
{
vendor:'TCS',
year:'2014',
value:'100',
leaf: true
}
]
},
{
sla: 'Variance',
vendor:'HCL',
year:'2014',
value:'93',
leaf: true
}
]
},
]
}
});
Ext.create('Ext.tree.TreePanel', {
renderTo: Ext.getBody(),
width: 1000,
height: 400,
title: 'People',
rootVisible:false,
store: store,
columns: [
{ xtype: 'treecolumn', header: 'SLA', dataIndex: 'sla', flex: 5 },
{ header: 'VENDOR', dataIndex: 'vendor', flex: 1 },
{ header: 'MONTH', dataIndex: 'year', flex: 1 },
{ header: 'VALUE', dataIndex: 'value', flex: 1 },
]
});
});
Aucun commentaire:
Enregistrer un commentaire