[CLOSED] Question about store

  1. #1

    [CLOSED] Question about store

    Hello

    I have a little problem.

    I have a lot of data to display. as my data are grouped, I choose to display them in elven grid, representing each one one of the group od data.

    For the moment, I have one store per grid, but to optimize data dransfert, I will try to have only one store and diaplaying only relevant data of each gid with that store.

    The problem seem to be that I can't set the same store for different grid.

    If I try to put it like that :

            
            grdOSA.Store.Add(stoOSA)
            grdMASK.Store.Add(stoOSA)
    I get an error on execution that said taht the store is already assign

    and if I try by the storeID of the grids, I see data in first grid but in the second, all is replaced by "undefined" in value.

    Is there a way to achieve that?

    And after that, I wish to use again the same store to draw charts.
    Last edited by Daniil; Apr 27, 2012 at 11:41 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Yes, the same Store cannot be added to Store collection of two GridPanels.

    So, you are right that you are trying to use StoreID.

    and if I try by the storeID of the grids, I see data in first grid but in the second, all is replaced by "undefined" in value.
    I am unable to reproduce this problem using the example below. Could you provide a sample?

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                this.Store1.DataSource = new object[] 
                { 
                    new object[] { "test1", "test2", "test3" },
                    new object[] { "test4", "test5", "test6" },
                    new object[] { "test7", "test8", "test9" },
                };
                this.Store1.DataBind();
            }
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
    
        <ext:Store ID="Store1" runat="server">
            <Model>
                <ext:Model runat="server">
                    <Fields>
                        <ext:ModelField Name="test1" />
                        <ext:ModelField Name="test2" />
                        <ext:ModelField Name="test3" />
                    </Fields>
                </ext:Model>
            </Model>
        </ext:Store>
    
        <ext:GridPanel runat="server" StoreID="Store1" AutoHeight="true">
            <ColumnModel runat="server">
                <Columns>
                    <ext:Column runat="server" Text="Test1" DataIndex="test1" />
                    <ext:Column runat="server" Text="Test2" DataIndex="test2" />
                    <ext:Column runat="server" Text="Test3" DataIndex="test3" />
                </Columns>
            </ColumnModel>
        </ext:GridPanel>
    
        <ext:GridPanel runat="server" StoreID="Store1" AutoHeight="true">
            <ColumnModel runat="server">
                <Columns>
                    <ext:Column runat="server" Text="Test1" DataIndex="test1" />
                    <ext:Column runat="server" Text="Test2" DataIndex="test2" />
                    <ext:Column runat="server" Text="Test3" DataIndex="test3" />
                </Columns>
            </ColumnModel>
        </ext:GridPanel>
    
    </body>
    </html>
  3. #3
    What I want to achieve is that:

    <%@ Page Language="C#" %>
      
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
     
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                this.Store1.DataSource = new object[] 
                { 
                    new object[] { "test1", "test2", "test3", "test11", "test21", "test31" },
                    new object[] { "test4", "test5", "test6", "test41", "test51", "test61" },
                    new object[] { "test7", "test8", "test9", "test71", "test81", "test91" },
                };
                this.Store1.DataBind();
            }
        }
    </script>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
     
        <ext:Store ID="Store1" runat="server">
            <Model>
                <ext:Model ID="Model1" runat="server">
                    <Fields>
                        <ext:ModelField Name="test1" />
                        <ext:ModelField Name="test2" />
                        <ext:ModelField Name="test3" />
                        <ext:ModelField Name="test4" />
                        <ext:ModelField Name="test5" />
                        <ext:ModelField Name="test6" />
                    </Fields>
                </ext:Model>
            </Model>
        </ext:Store>
     
        <ext:GridPanel ID="GridPanel1" runat="server" StoreID="Store1" AutoHeight="true">
            <ColumnModel ID="ColumnModel1" runat="server">
                <Columns>
                    <ext:Column ID="Column1" runat="server" Text="Test1" DataIndex="test1" />
                    <ext:Column ID="Column2" runat="server" Text="Test2" DataIndex="test2" />
                    <ext:Column ID="Column3" runat="server" Text="Test3" DataIndex="test3" />
                </Columns>
            </ColumnModel>
        </ext:GridPanel>
     
        <ext:GridPanel ID="GridPanel2" runat="server" StoreID="Store1" AutoHeight="true">
            <ColumnModel ID="ColumnModel2" runat="server">
                <Columns>
                    <ext:Column ID="Column4" runat="server" Text="Test4" DataIndex="test4" />
                    <ext:Column ID="Column5" runat="server" Text="Test5" DataIndex="test5" />
                    <ext:Column ID="Column6" runat="server" Text="Test6" DataIndex="test6" />
                </Columns>
            </ColumnModel>
        </ext:GridPanel>
     
    </body>
    </html>
    and it works, so I have to find on my side what is wrong.

    thanks for your help.
  4. #4
    I would ensure ModelFields Names and Columns DataIndexes are correct.
  5. #5
    Yes, you are totaly right, my apologize, when reading you I have just understand that I have not refund the stores in one...
  6. #6
    Problem related.

    Please se that : http://forums.ext.net/showthread.php...0606#post80606

Similar Threads

  1. [CLOSED] Store Question
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 13
    Last Post: Feb 25, 2011, 12:02 AM
  2. A question about store
    By wxmayifei in forum 1.x Help
    Replies: 2
    Last Post: Oct 14, 2010, 8:35 AM
  3. [CLOSED] [1.0] Store Submit Question
    By ljankowski in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Aug 20, 2010, 3:38 PM
  4. a Store question
    By Adam in forum 1.x Help
    Replies: 1
    Last Post: Mar 30, 2010, 5:08 PM
  5. [CLOSED] Store Question
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Apr 03, 2009, 3:56 PM

Posting Permissions