lundi 5 mai 2014

HOW TO GET THE PARENT DATA ON CLICK OF CHILD VALUE IN TREE GRID

here is my js.

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 },


]

});


});


I am attaching my output.

On click of any value of YEAR or VALUE

I want to get its corresponding SLA Value.

Kindly suggest me a solution.





Aucun commentaire:

Enregistrer un commentaire