Jul 22, 2016, 12:52 PM
[CLOSED] Header of grid added via ExtJS to a markup panel, not showing
Hi all, I have a problem with grid headers not showing when I add an ExtJS grid to a markup Panel....
I'm creating dynamically a grid in a JS function and then adding it to the panel from the markup, like shown below:
This is code from ExtJS 4 and Ext.net 2.5, is that a migration issue?
I'm using ExtJS 6 and ExtNet 4.1 now...
I'm creating dynamically a grid in a JS function and then adding it to the panel from the markup, like shown below:
//From a part of the JS function ------------------------
//buildGrid creates a Ext.create('Ext.grid.Panel', { ... })
content = buildGrid();
var vp = Ext.getCmp("SettingsXPanel");
//Deletes previous added items to the panel
var f;
while (f = vp.items.first()) {
vp.remove(f, true);
}
vp.items.add(content);
vp.updateLayout(); //Refreshes the layout after the grid is added
content.getView().refresh(); //Not sure if needed
The Markup:<ext:Viewport ID="Viewport1" runat="server" Layout="BorderLayout">
<Items>
<ext:Button runat="server" ID="RefreshGridBtn" Region="North">
<Listeners>
<Click Fn="refreshBtnClicked"></Click>
</Listeners>
</ext:Button>
<ext:Container ID="Panel_SettingsXContainer" runat="server" Hidden="false" Split="true" Region="Center" Layout="BorderLayout">
<Items>
<ext:Panel runat="server" ID="SettingsXPanel" Region="Center" OverflowY="Auto"></ext:Panel>
</Items>
</ext:Container>
</Items>
</ext:Viewport>
However, the grid headers are not shown in the first add, but if I call the function again (after the page has already loaded), the grid will refresh and show all the data/headers correctly...This is code from ExtJS 4 and Ext.net 2.5, is that a migration issue?
I'm using ExtJS 6 and ExtNet 4.1 now...
Last edited by fabricio.murta; Aug 04, 2016 at 4:52 PM.