PDA

View Full Version : How to add a grid to Ext.ux.RowExpander



pra123@
18 Apr 2013, 8:15 AM
Hi,

I have a grid panel.
I am using RowExpander plugin.
I am doing like this

var grid1 = Ext.create('Ext.grid.Panel', { store: getLocalStore(), columns: [ {text: "Company", flex: 1, dataIndex: 'company'}, {text: "Price", renderer: Ext.util.Format.usMoney, dataIndex: 'price'}, {text: "Change", dataIndex: 'change'}, {text: "% Change", dataIndex: 'pctChange'}, {text: "Last Updated", renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'} ], enableLocking: true, width: 600, height: 300, plugins: [{ ptype: 'rowexpander', rowBodyTpl : new Ext.XTemplate( '<p><b>Company:</b> {company}</p>', '<p><b>Change:</b> {change:this.formatChange}</p><br>', '<p><b>Summary:</b> {desc}</p>', { formatChange: function(v){ var color = v >= 0 ? 'green' : 'red'; return '<span style="color: ' + color + ';">' + Ext.util.Format.usMoney(v) + '</span>'; } }) }], collapsible: true, animCollapse: false, title: 'Expander Rows in a Collapsible Grid with lockable columns', iconCls: 'icon-grid', margin: '0 0 20 0', renderTo: Ext.getBody() });
How i can add a grid to rowBodyTpl?
Please someone help?

thanks in advance.

slemmon
19 Apr 2013, 10:29 PM
While grids don't offer a way to render components into the cells/rows right from the framework you might take a look at this user extension:
http://skirtlesden.com/ux/component-column (http://skirtlesden.com/ux/component-column)