-
23 Feb 2011 12:43 AM #1
[FIXED] Grid data not rendered in TabPanel on none active tab
[FIXED] Grid data not rendered in TabPanel on none active tab
in a TabPanel data of a grid is currently not rendered if I reload the data from my backend and the tab thats the container of the grid is not the activeTab. If it´s the activeTab data is rendered correctly.
Have a look at the following example.
When "First tab" is active and I press the "Refresh" button the new data is not rendered in the grid of "Second tab". The initial store.loadData inside initComponent works fine.
Any clues or is it a bug of the early preview version?
PHP Code:Ext.require([
'Ext.grid.*',
'Ext.data.*',
'Ext.util.*',
'Ext.state.*'
]);
Ext.define('SO.ux.dummy.GridInTabpanel', {
extend: 'Ext.panel.Panel',
myData: [
{company:'3m Co', change:71.72, pctChange: 0.02},
{company:'Alcoa Inc', change:29.01, pctChange: 0.42},
{company:'Altria Group Inc', change:83.81, pctChange: 0.28},
{company:'American Express Company', change:52.55, pctChange:0.01}
],
initComponent: function() {
var store = Ext.create('Ext.data.ArrayStore', {
fields: [
{name: 'company'},
{name: 'change', type: 'float'},
{name: 'pctChange', type: 'float'}
],
//data: this.myData
});
store.loadData(this.myData, false);
Ext.apply(this, {
xtype: 'panel',
layout: 'fit',
minWidth: 100,
minHeight: 100,
title: 'Container',
items: [{
xtype: 'tabpanel',
activeTab: 0,
defaults: {
labelWidth: 150
},
deferredRender: false,
layoutConfig: {
deferredRender: false
},
ref: '../../editPanel',
id: 'editPanel',
items: [
{
xtype: 'panel',
layout: 'vbox',
title: 'First Tab',
items: [
{
xtype: 'textfield',
width: 400,
fieldLabel: 'Name',
name: 'name',
id: 'name'
}
]
},
{
xtype: 'panel',
title: 'Second Tab',
layout: 'fit',
autoHeight: true,
autoScroll: true,
items: [
{
xtype: 'gridpanel',
store: store,
autoHeight: true,
stripeRows: true,
autoExpandColumn: 1,
id: 'myGrid',
headers: [{
id :'company',
text : 'Company',
//width: 120,
flex: 1,
sortable : true,
dataIndex: 'company'
},{
text : 'Change',
width : 75,
sortable : true,
renderer : this.change,
dataIndex: 'change'
},{
text : '% Change',
width : 75,
sortable : true,
renderer : this.pctChange,
dataIndex: 'pctChange'
}]
}
]
}
]
}],
dockedItems: [{
xtype: 'toolbar',
dock: 'top',
items: [{
xtype: 'button',
text: 'Refresh',
id: 'btnRefresh'
}]
}]
});
this.callParent(arguments);
Ext.getCmp('btnRefresh').on('click', this.onRefresh, this);
},
onRefresh: function() {
var localData = [
{company:'ABC', change: 71.72, pctChange: 0.02},
{company:'DEF', change: 29.01, pctChange: 0.42},
{company:'GHI', change: 83.81, pctChange: 0.28}
]
var store = Ext.getCmp('myGrid').store;
store.loadData(localData, false);
Ext.Msg.alert('Refresh', 'Data has been refreshed');
}
});
-
23 Feb 2011 4:23 AM #2
I noticed the same thing. From what I've seen, if you resize one of the grid's column, the data magically appears.
-
23 Feb 2011 4:30 AM #3
This is a bug, we'll look into it. Thanks.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
23 Feb 2011 4:40 AM #4
-
23 Feb 2011 6:15 PM #5
This will be fixed in the PR2 release coming out soon.
Aaron Conran
@aconran
Sencha Architect Development Team
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
[Solved] TabPanel with 2 grids only grid in active tab gets rendered
By MacUnix in forum Ext 3.x: Help & DiscussionReplies: 8Last Post: 8 Feb 2011, 4:57 AM -
TabPane(IGNORE) l with 2 grids only grid in active tab get rendered
By MacUnix in forum Ext 3.x: Help & DiscussionReplies: 0Last Post: 3 Feb 2011, 6:57 AM -
[FIXED] FormPanel in a non active TabPanel: bad displacement
By paolocavelli in forum Ext 3.x: BugsReplies: 2Last Post: 12 Mar 2010, 10:36 AM -
[FIXED-430][3.??] Ext.TabPanel active bottom tab css failure
By makana in forum Ext 3.x: BugsReplies: 4Last Post: 18 Jan 2010, 11:21 AM -
Tabpanel sends only data from active panel?
By Dumas in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 26 Mar 2009, 10:39 AM


Reply With Quote
