[CLOSED] Store c# DataBind() Method in v3.2 problem

  1. #1

    [CLOSED] Store c# DataBind() Method in v3.2 problem

    hi.

    souce code
           <ext:ResourceManager runat="server" ShowWarningOnAjaxFailure="false" />
    
            <asp:SqlDataSource ID="sds1" runat="server" ConnectionString="<%$ ConnectionStrings:Con_Test %>"
                SelectCommand="SELECT id, col1, col2">
            </asp:SqlDataSource>
    
    	<ext:Store runat="server" ID="store1" DataSourceID="sds1">
                <Model>
                    <ext:Model runat="server" IDProperty="id">
                        <Fields>
                            <ext:ModelField Name="id" Type="Int" />
                            <ext:ModelField Name="col1" Type="String" />
                            <ext:ModelField Name="col2" Type="String" />
                        </Fields>
                    </ext:Model>
                </Model>
            </ext:Store>
    
            <ext:GridPanel ID="grid1" StoreID="store1" runat="server">
                        <ColumnModel runat="server">
                            <Columns>
                                <ext:Column runat="server" Text="id" DataIndex="id" Width="55" />
                                <ext:Column runat="server" Text="col1" DataIndex="col1" Flex="1" />
                                <ext:Column runat="server" Text="col2" DataIndex="col2" Flex="1" />
                            </Columns>
                        </ColumnModel>
             </ext:GridPanel>
    
             <ext:Button runat="server" Text="Load">
                <Listeners>
                    <Click Handler="var store = App.store1; App.direct.Store_Load([store.storeId], { eventMask: { showMask: true, msg: 'wait' } });" />
                </Listeners>
            </ext:Button>
    cs code
            [DirectMethod]
            public void Store_Load(string[] comList)
            {
                foreach (var item in comList)
                {
                    try
                    {
                        Store com = this.Page.FindControl(item.ToString()) as Store;
    
                        com.DataBind();
                    }
                    catch (Exception)
                    {
    
                    }
                }
            }
    The first step: when the page is opened records loaded.
    The second step: I'm adding records to the database manually.
    The third step: I click the load button.

    I added manually does not come on record.
    I added in version 3.0 came on record with manually.
    Did changes in version 3.2?
    Last edited by fabricio.murta; Sep 03, 2015 at 11:04 PM. Reason: [CLOSED]
  2. #2
    Hi @siyahgul,

    I cannot reproduce. For the sake of testing I replaced SqlDataSource with ObjectDataSource.

    Example
    <%@ Page Language="C#" %>
    
    <script runat="server">
        [DirectMethod]
        public void Store_Load(string[] comList)
        {
            foreach (var item in comList)
            {
                try
                {
                    Store com = this.Page.FindControl(item.ToString()) as Store;
    
                    com.DataBind();
                }
                catch (Exception)
                {
                }
            }
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v3 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <asp:ObjectDataSource
                ID="ObjectDataSource1"
                runat="server"
                TypeName="Test"
                SelectMethod="GetTestData" />
    
            <ext:Button runat="server" Text="Load">
                <Listeners>
                    <Click Handler="App.direct.Store_Load([ App.Store1.storeId ], { eventMask: { showMask: true, msg: 'wait' } });" />
                </Listeners>
            </ext:Button>
    
            <ext:GridPanel runat="server">
                <Store>
                    <ext:Store ID="Store1" runat="server" DataSourceID="ObjectDataSource1">
                        <Model>
                            <ext:Model runat="server">
                                <Fields>
                                    <ext:ModelField Name="test1" />
                                    <ext:ModelField Name="test2" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column runat="server" Text="Test 1" DataIndex="test1" Width="150" />
                        <ext:Column runat="server" Text="Test 2" DataIndex="test2" Width="150" />
                    </Columns>
                </ColumnModel>
            </ext:GridPanel>
        </form>
    </body>
    </html>
    Test.cs
    public class Test
    {
        public object[] GetTestData()
        {
            var ticks = System.DateTime.Now.Ticks;
    
            return
                new object[] 
                { 
                    new object[] { ticks, ticks },
                    new object[] { ticks, ticks }
                };
        }
    }
    The test case doesn't add new data, but it tests a store.DataBind() call inside a DirectMethod which appears to be working. In this aspect there is no difference in Ext.NET logic for SqlDataSource and ObjectDataSource.

    The third step: I click the load button.
    Please clarify what does happen after that? Is Store_Load DirectMethod being executed? What is a response?
  3. #3
    hi Daniil.

    You have this code, you'll be testing, or you will not. I'm having this problem right now. "DataBind ()" method works when the database manually entered records do not come. "js" side "store.load ();" I also do not come.

    good working.
  4. #4
    I am afraid we don't have access to a database that you are dealing with and I am not sure it is going to be reproducible with any database.

    There is a good chance that answers to my questions (from my previous post) could clarify the situation and lead to some guesses what is going on.
  5. #5
    hi Daniil.

    you can use my database in Tomorrow. but I have to send you a private message.

    good working brother.
  6. #6
    Hello,

    Please do not send you database to us. I you do, we will delete the message or email

    Please review the Forum Guidelines before proceeding, see

    http://forums.ext.net/showthread.php...ation-Required

    All code samples required to reproduce the problem must be posted in the forums between [CODE] tags.
    Geoffrey McGill
    Founder
  7. #7
    hi Daniil.

    problem solved. "web.config" file that you need to add the following code

    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
            <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Ext.Net.Utilities" publicKeyToken="2c34ac34702a3c23" />
            <bindingRedirect oldVersion="0.0.0.0-2.5.0" newVersion="2.5.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="Transformer.NET" publicKeyToken="e274d618e7c603a7" />
            <bindingRedirect oldVersion="0.0.0.0-2.1.1" newVersion="2.1.1" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    thank you. good working.

Similar Threads

  1. [CLOSED] store.insert method + store page size problem
    By mcfromero in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 12, 2012, 6:34 AM
  2. Store DataBind in DirectEvents
    By threewonders in forum 1.x Help
    Replies: 1
    Last Post: Nov 03, 2011, 10:04 AM
  3. fasten databind to store
    By Birgit in forum 1.x Help
    Replies: 0
    Last Post: Sep 15, 2010, 7:04 AM
  4. Problem with Store.DataBind
    By flaviodamaia in forum 1.x Help
    Replies: 0
    Last Post: Nov 20, 2009, 9:22 AM
  5. Databind / Reload Store and GridPanel Problem
    By locoperoguapo in forum 1.x Help
    Replies: 5
    Last Post: Feb 10, 2009, 9:23 AM

Posting Permissions