[CLOSED] Populating GridPanel Store from CodeBehind

  1. #1

    [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. :(
    Attached Thumbnails Click image for larger version. 

Name:	popup.PNG 
Views:	84 
Size:	25.3 KB 
ID:	14201  
    Last edited by Daniil; Aug 22, 2014 at 11:13 AM. Reason: [CLOSED]
  2. #2
    Hi @elisa,

    I think you should define an ArrayReader for the Store. Please try.
  3. #3
    That worked, thanks.
    I was following this example so I'm not sure what the difference is...?
  4. #4
    Well, the difference that you bind the data during a DirectEvent, but it is done initially in that example.

    Though, I would define an ArrayReader in that example as well.

Similar Threads

  1. [CLOSED] Populating a Store in ascx
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 12
    Last Post: Oct 28, 2013, 2:10 PM
  2. [CLOSED] ComboBox Not Populating on First Store Reload
    By elisa in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 02, 2013, 4:17 PM
  3. Populating GridPanel in codebehind
    By extneter in forum 2.x Help
    Replies: 0
    Last Post: Jul 10, 2013, 11:10 AM
  4. Replies: 6
    Last Post: Oct 22, 2012, 12:51 PM
  5. Populating ComboBox from Store on page load
    By ikhwanhayat in forum 1.x Help
    Replies: 7
    Last Post: Feb 06, 2012, 3:56 PM

Tags for this Thread

Posting Permissions