PDA

View Full Version : Rowexpander Dynamic Content (Chart/Grid Panel)



digitalwerker
12 Mar 2012, 5:01 AM
Hey!

I am currently stuck on a project using ExtJS 4.0.7 and the rowexpander PlugIn.

What i would like to do is to load a chart and a grid into the content of the rowexpander PlugIn.

Could you try to help me on this problem?

In addition to get this thing running i tried to add an eventlistener on the beforeExpand Event. However he doesnt even calls this one :/. What would be next steps to load the requried charts and grids?

My Code:


Ext.define('dashboard.view.ui.positionGrid', {
extend: 'Ext.grid.Panel',
plugins: [{
ptype: 'rowexpander',
rowBodyTpl: [
'<div class="positionChart">###POSITION_GRAPH###</div>',
'<div class="positionTable">###POSITION_TABLE###</div>'
]
}],
width: 988,
listeners: {
beforeExpand: function(ex,record,body,rowIndex){
//Load Data into Rowexpander?
console.log('expanded');
},
el: {
beforeExpand: function(ex,record,body,rowIndex){ console.log('expanded'); },
// click: function(){console.log('click');},
}
},
border:0,
cls: 'gridRow',
store: 'positionStore',
initComponent: function() {
var me = this;

Ext.applyIf(me, {
collapsible: true,
animCollapse: false,
iconCls: 'icon-grid',
columns: [
{
dataIndex: 'isin',
flex: 3,
text: 'ISIN'
},
{
dataIndex: 'name',
flex: 5,
text: 'Name'
},
{
dataIndex: 'anschaffungswert',
flex: 3,
text: 'Anschaffungswert',
},
{
dataIndex: 'buchwert',
flex: 3,
text: 'Buchwert',
},
{
dataIndex: 'marktwert',
flex: 3,
text: 'Marktwert',
},
{
dataIndex: 'last_transaction',
flex: 3,
text: 'Letzte Transaktion',
},
]
});

me.callParent(arguments);
}
});


Thank you guys!

Greetings

mitchellsimoens
12 Mar 2012, 7:53 AM
When the row is expanded you need to render what you need in the body of the row expander. You can see how I did it in my AssociationRowExpander plugin https://github.com/mitchellsimoens/Ux.grid.plugin.AssociationRowExpander

digitalwerker
27 Mar 2012, 7:24 AM
Thank you,

and sorry for my late reply. Managed to get it working with this plugin.

Right now my Rowexpander consists of 4 different charts and 2 grid panels ;).

Greetings!

V001Sencha
18 Jun 2013, 2:16 AM
Hi Team,

I am stuck with getting a chart inside a cell of a grid panel. Kindly share any examples. Does EXT 4.2 supports displaying of charts inside a grid panel cell..??

Thank you