Chir
Chir

Reputation: 691

ExtJS4 Grid with RowExpander

I need to display a form in the rowexpander. In order to do that I am planning to create a temporary div as part of rowexpander and then attach a form to it during expandbody event. However, I am confused as to how to register expandbody listener for RowExpander.

Please help me.

Thanks

Upvotes: 1

Views: 4044

Answers (2)

Nabil
Nabil

Reputation: 21

Use 'pluginId' property to get access to the RowExpander plugin object.

Here is an example taken from the RowExpander docs

var grid = Ext.create('Ext.grid.Panel', {

    plugins: [{
        ptype: 'cellediting',
        clicksToEdit: 2,
        pluginId: 'cellplugin'
    }]
});



// later on:

var plugin = grid.getPlugin('cellplugin');

Upvotes: 2

dbrin
dbrin

Reputation: 15673

Are you sure you don't want to use the regular roweditor? Or popup a window with the record loaded into the form?


EDIT: If that's all you want then just follow the example from Sencha. Essentially all you do is specify a template of how you want your data rendered in the plugin config. You don't need to listen to expand events just to render data.

plugins: [{
            ptype: 'rowexpander',
            rowBodyTpl : [
                '<p><b>Company:</b> {company}</p><br>',
                '<p><b>Summary:</b> {desc}</p>'
            ]
        }],

Upvotes: 2

Related Questions