[CLOSED] simple gridpanel databind not working in v2.1

  1. #1

    [CLOSED] simple gridpanel databind not working in v2.1

    The following code works in v2.0 but not in v2.1. Would you please take a look?
    <%@ Page Language="C#" %>
    
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    
    
    <script runat="server">
       
        protected void Page_Load(object sender, EventArgs e)
        {
            List<object> list = new List<object>();
            list.Add(new
            {
                asCode = "abc",
                asName = "cde",
                asPerc = 10.1
    
    
            });
            strAssetClassOfInstrument.Data = list;
            strAssetClassOfInstrument.DataBind();
    
        }
        
       
      
    </script>
    
    <!DOCTYPE html>
    
    <html>
    
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
            
         
        
    
                    <ext:Panel ID="pnlHost" runat="server" Layout="HBoxLayout" FocusOnToFront="true" Border="false"  >
                                            <Items>
    
                                                <ext:GridPanel ID="Grid1" runat="server" Width="170" Height="155" Padding="5">
                                                    <Store>
                                                        <ext:Store ID="strAssetClassOfInstrument" runat="server">
                                                            <Model>
                                                                <ext:Model ID="Model4" runat="server">
                                                                    <Fields>
                                                                          <ext:ModelField Name="asCode"  />
                                                                            <ext:ModelField Name="asName"  />                                                           
                                                                            <ext:ModelField Name="asPerc"  />
                                                                           
                                                                          
                                                                    </Fields>
                                                                </ext:Model>
                                                            </Model>
                                                        </ext:Store>
                                                    </Store>
    
                                                    <ColumnModel>
                                                        <Columns>
                                                            <ext:Column ID="Column2" runat="server" Text="Name" DataIndex="asName" Flex="1"/>
                                                            <ext:Column ID="Column3" runat="server" Text="%" DataIndex="asPerc" Width="60" />
                                                        </Columns>
                                                    </ColumnModel>
                                                </ext:GridPanel>
    
                                     
                                            
                                            </Items>
                                        </ext:Panel>
         
    
        </form>
      </body>
    </html>
    Last edited by Daniil; Jul 25, 2012 at 12:59 AM. Reason: [CLOSED]
  2. #2
    It is fixed in SVN already

    If you use Data then DataBind is not required (Data will be serialized as it is, with all properties)
    DataBind is used for DataSource only (DataSource is serialized according store's Model)
    Last edited by Daniil; Aug 17, 2012 at 9:38 AM.
  3. #3
    Thanks it's working now!! :)

    However about the DataBind() function, you still need that if you updating the Data property in DirectMethods (i.e. not within page_load function).
  4. #4
    If you need to load a data during DirectEvent/DirectMethod, please use:
    store.LoadData(new object[] 
        { 
            new { test = "new" },
        });

Similar Threads

  1. GridPanel Databind Not Working
    By tozza_d in forum 1.x Help
    Replies: 1
    Last Post: Aug 01, 2012, 10:58 AM
  2. [CLOSED] Simple Tasks sample not working
    By bogc in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: May 31, 2012, 12:40 PM
  3. Simple Window.show() not working
    By Tbaseflug in forum 2.x Help
    Replies: 3
    Last Post: May 23, 2012, 2:37 PM
  4. simple DirectMethod call not working?
    By phinoppix in forum 1.x Help
    Replies: 2
    Last Post: Jul 05, 2011, 12:12 PM
  5. store databind from server not working
    By Devworks in forum 1.x Help
    Replies: 11
    Last Post: Feb 06, 2009, 11:14 AM

Tags for this Thread

Posting Permissions