Reputation: 41117
To add a grid, I have this code. How I pass extra parameters to 'myGrid'?
tabPanel.add({ xtype : 'myGrid' });
Upvotes: 0
Views: 404
Reputation: 179
Yes you can pass parameters and other properties like this:
var addGrid=function (store){
tabPanel.add({
xtype: 'myGrid',
autoScroll: true,
**store: store, //parameter**
columns: [{
text: 'Company',
flex: 1,
sortable: true,
dataIndex: 'company'
}, {
text: 'Price',
flex: 1,
sortable: true,
dataIndex: 'price'
}],
viewConfig: {
autoFit: true
}
});
}
Upvotes: 2
Reputation: 146
You can pass a value to the grid with this syntax
var grid = Ext.create('{NAMESPACE PATH HERE}.view.myGrid', { id: id}); tabPanel.add(grid);
Upvotes: 1