Aug 13, 2014, 2:07 PM
[CLOSED] Populating GridPanel Store from CodeBehind
I'm trying to populate the Store ServerDetailsStore in this pop-up window:
<ext:Window runat="server" ID="DetailsPopUp" Region="Center" Width="1225" Height="525"
Hidden="true" Layout="VBoxLayout" Maximizable="true" TitleAlign="Center" TitleCollapse="true">
<LayoutConfig>
<ext:VBoxLayoutConfig Align="Stretch" />
</LayoutConfig>
<Items>
<ext:Panel runat="server" Layout="HBoxLayout" Flex="1">
<LayoutConfig>
<ext:HBoxLayoutConfig Align="Stretch" />
</LayoutConfig>
<Items>
<ext:GridPanel ID="DetailsGrid" runat="server" Title="Server Details" Frame="true"
Flex="1" HideHeaders="true">
<Store>
<ext:Store ID="ServerDetailsStore" runat="server" AutoLoad="true">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="FIELD" Type="String" />
<ext:ModelField Name="VALUE" Type="String" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:Column runat="server" DataIndex="FIELD" Width="150" />
<ext:Column runat="server" DataIndex="VALUE" Flex="1" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel runat="server" EnableTextSelection="true" />
</SelectionModel>
<View>
<ext:GridView runat="server" EnableTextSelection="true" />
</View>
</ext:GridPanel>
<ext:GridPanel ID="FilesystemGrid" runat="server" Title="Filesystem" Frame="true"
Flex="1">
</ext:GridPanel>
</Items>
</ext:Panel>
<ext:Panel runat="server" Layout="HBoxLayout" Flex="1">
<LayoutConfig>
<ext:HBoxLayoutConfig Align="Stretch" />
</LayoutConfig>
<Items>
<ext:GridPanel ID="CPUGrid" runat="server" Title="CPU" Frame="true" Flex="1">
</ext:GridPanel>
<ext:GridPanel ID="MemoryGrid" runat="server" Title="Memory" Frame="true" Flex="1">
</ext:GridPanel>
</Items>
</ext:Panel>
</Items>
</ext:Window>
There is a DirectMethod that is called when user clicks a button to pop-up the window:[DirectMethod]
public void PopulateDetailsPopUp(string ComponentID, string Hostname, string DataCenter, string Environment, string OperatingSystem, string PhysicalVirtual)
{
this.ServerDetailsStore.DataSource = new object[]
{
new object[] { "Host Name", Hostname },
new object[] { "Datacenter", DataCenter },
new object[] { "Environment", Environment },
new object[] { "Operating System", OperatingSystem },
new object[] { "Physical/Virtual", PhysicalVirtual }
};
this.ServerDetailsStore.DataBind();
this.DetailsPopUp.Show();
}
The window pops up and the grid shows 5 rows where the data should be, but there is no data. :(
Last edited by Daniil; Aug 22, 2014 at 11:13 AM.
Reason: [CLOSED]