PDA

View Full Version : Sencha extjs 4.1.1a Grid bug?



Alex2013
14 Feb 2013, 1:40 AM
Hi.

I am using the MVC pattern for designing apps in Sencha Extjs. My problem is that the plugin section (and some other properties) that i use in the define section , does not come into the grid when I define it and then create it with the Ext.create funtion. My code looks like this:



Ext.define('LP.view.TestList', {
extend: 'Ext.grid.Panel',
alias : 'widget.testlist',
id : 'TestList',
store : 'TestListStore',
title : 'Test list',
padding : 0.2,
columns: [
{
text: 'Transactions',
dataIndex: 'Transactions',
editor: {
xtype: 'numberfield',
allowBlank: false,
}
},
{
text: 'Users',
dataIndex: 'Users',
flex: 1,
editor: {
xtype: 'numberfield',
allowBlank: false,
minValue: 0,
maxValue: 100000
}
}
],
renderTo: Ext.getBody(),
selType: 'cellmodel',
plugins: [
{
ptype: 'rowexpander',
rowBodyTpl: [
'<div id="{id}">',
'</div>'
]
}
)]
});


Do this to create it:


var list = Ext.create('LP.view.TestList');

Now I expect to get the RowExpander into the grid. But that does not happen.

But if i remove the plugin part of the code in the definition of the gird panel and move it to the create function instead. it works and the row expander show up as expected:



var list = Ext.create('LP.view.TestList', plugins: {
ptype: 'rowexpander',
rowBodyTpl: [
'<div id="{id}">',
'</div>'
]
});



Is this a bug or am I totally missing the point as to how to create grid panels dynamically?

sword-it
14 Feb 2013, 5:04 AM
Hi Alex,

Try this sample example-

http://www.mysamplecode.com/2012/04/extjs-grid-rowexpander-expandall.html