[CLOSED] Controls not showing data in store in AfterRender event of window

  1. #1

    [CLOSED] Controls not showing data in store in AfterRender event of window

    Hi,

    I am trying a load the store for some controls on a window in the afterrender event. The store has the data but the data is not being displayed in the controls. See example below with combo box. happens with the other data controls that uses a store. please advise, this worked in version 1.0.

    I tried using the Show event but the event does not seem to work.


    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <script type="text/javascript">
        var getData = function (operation) {
            var data = Array();
            var item = { Key: 1, Value: "Name" }
            data.push(item);
            item = { Key: 1, Value: "Surname" }
            data.push(item);
    
            var Combo1 = Ext.getCmp("Combo1")
            var Combo2 = Ext.getCmp("Combo2")
            App.combo1.store.loadData(data);
            App.combo2.store.loadData(data);
        };
    
    </script>
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
        <style type="text/css">
            .my-cells .x-grid-cell-inner  {
                white-space: normal;
            }
        </style>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:Window ID="windowExportWorkItems" runat="server" AutoHeight="true" Width="300"
            Title="Load combo" Draggable="true" Resizable="false" Modal="true" IDMode="Static"
            Closable="true">
            <Defaults>
                <ext:Parameter Name="IDMode" Value="Static" />
            </Defaults>
            <Items>
                <ext:ComboBox ID="combo1" runat="server" TabIndex="61" FieldLabel="Combo1" Width="250"
                    DisplayField="Value" AnchorHorizontal="100%" QueryMode="Local" AutoDataBind="true"
                    EnableKeyEvents="true" Editable="true" ForceSelection="true">
                    <Store>
                        <ext:Store runat="server">
                            <Model>
                                <ext:Model runat="server">
                                    <Fields>
                                        <ext:ModelField Name="Key" />
                                        <ext:ModelField Name="Value" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <Listeners>
                        
                    </Listeners>
                </ext:ComboBox>
                <ext:ComboBox ID="combo2" runat="server" TabIndex="61" FieldLabel="Combo2" Width="250"
                    DisplayField="Value" AnchorHorizontal="100%" QueryMode="Local" AutoDataBind="true"
                    EnableKeyEvents="true" Editable="true" ForceSelection="true">
                    <Store>
                        <ext:Store runat="server">
                            <Model>
                                <ext:Model runat="server">
                                    <Fields>
                                        <ext:ModelField Name="Key" />
                                        <ext:ModelField Name="Value" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <Listeners>
                    </Listeners>
                </ext:ComboBox>
            </Items>
            <Listeners>
                <AfterRender Handler="getData();" />
            </Listeners>
            </ext:Window>
    </body>
    </html>
    Last edited by Daniil; Sep 03, 2012 at 6:16 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I would set up
    AutoLoad="false"
    for the both Stores to fix it.

Similar Threads

  1. [CLOSED] Problem hiding/showing controls
    By tlfdesarrollo in forum 1.x Premium Help
    Replies: 1
    Last Post: May 29, 2012, 4:37 PM
  2. GridPanel showing data return Store.Count value 0
    By abhi_sheklohiya in forum 1.x Help
    Replies: 3
    Last Post: Mar 26, 2012, 8:06 PM
  3. No data showing
    By zaggle in forum 1.x Help
    Replies: 2
    Last Post: Mar 23, 2012, 2:09 AM
  4. .Net 4.0, grid hosting controls not showing
    By tallman in forum 1.x Help
    Replies: 14
    Last Post: Aug 30, 2011, 11:00 PM
  5. Replies: 1
    Last Post: Jun 21, 2011, 1:44 PM

Posting Permissions