[CLOSED] Modified Grid Data not Retains when navigating through page

Page 1 of 2 12 LastLast
  1. #1

    Modified Grid Data not Retains when navigating through page

    Hi:

    I have Grid with records for 2 pages, i have a editable column in the grid, i had modified a record value from "100" to "200" in first page, then navigated to the second page, and again when i come to first page, the modified value "200" is not available. It shows the old value "100". pls help me on this
    Last edited by speedstepmem3; Nov 09, 2011 at 4:11 AM.
  2. #2
    Hi,

    I guess you use remote paging.

    If so, you should know that every page change causes a load request to a remote store (I guess, you use a database) and a store/grid get a new data which know nothing about any changes on a client if you don't save them.
  3. #3
    Hi Daniil:

    I have configured the store as given below and the grid is assigned with the store id. I am not using any Remote Paging or Remote Store. the value get binded only when page is loaded. Help me on this.


    
           <ext:Store ID="storeGrid" runat="server" IgnoreExtraFields="true" OnBeforeStoreChanged="StoreGrid_BeforeChanged"
                WarningOnDirty="false" OnRefreshData="StoreGrid_Refreshed">
                <Reader>
                    <ext:JsonReader IDProperty="Key">
                        <Fields>
       <ext:RecordField Name="Key" />
                            <ext:RecordField Name="EprotexStatus" />
                            <ext:RecordField Name="CreatedStatus" />
                            <ext:RecordField Name="EprotexProcessStatus" />
                        </Fields>
                    </ext:JsonReader>
                </Reader>
            </ext:Store>
    Quote Originally Posted by Daniil View Post
    Hi,

    I guess you use remote paging.

    If so, you should know that every page change causes a load request to a remote store (I guess, you use a database) and a store/grid get a new data which know nothing about any changes on a client if you don't save them.
  4. #4
    I was unable to reproduce it, here is my test case.

    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)
            {
                Store store = this.GridPanel1.GetStore();
                store.DataSource = new object[] 
                { 
                    new object[] { "test1" },
                    new object[] { "test2" },
                    new object[] { "test3" },
                    new object[] { "test4" },
                    new object[] { "test5" },
                    new object[] { "test6" },
                    new object[] { "test7" },
                    new object[] { "test8" },
                    new object[] { "test9" }
                };
                store.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 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true">
                <Store>
                    <ext:Store runat="server">
                        <Reader>
                            <ext:ArrayReader>
                                <Fields>
                                    <ext:RecordField Name="test" />
                                </Fields>
                            </ext:ArrayReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column Header="Test" DataIndex="test">
                            <Editor>
                                <ext:TextField runat="server" />
                            </Editor>
                        </ext:Column>
                    </Columns>
                </ColumnModel>
                <BottomBar>
                    <ext:PagingToolbar runat="server" PageSize="3" />
                </BottomBar>
            </ext:GridPanel>
        </form>
    </body>
    </html>
  5. #5

    Modified Grid Data not Retains when navigating through page

    Hi Daniil,
    I was able to reproduce it, here is my test case. I just added the Grid Filters, when there is no Grid Filters it works perfectly. Now help me on this.

    <%@ 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)
            {
                Store store = this.GridPanel1.GetStore();
                store.DataSource = new object[] { new object[] { "test1" }, 
                    new object[] { "test2" }, 
                    new object[] { "test3" }, 
                    new object[] { "test4" }, 
                    new object[] { "test5" }, 
                    new object[] { "test6" }, 
                    new object[] { "test7" }, 
                    new object[] { "test8" }, 
                    new object[] { "test9" } };
                store.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 Example</title>
    </head>
    <body>
        <form id="Form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true">
            <Store>
                <ext:Store ID="Store1" runat="server">
                    <Reader>
                        <ext:ArrayReader>
                            <Fields>
                                <ext:RecordField Name="test" />
                            </Fields>
                        </ext:ArrayReader>
                    </Reader>
                </ext:Store>
            </Store>
            <ColumnModel ID="ColumnModel1" runat="server">
                <Columns>
                    <ext:Column Header="Test" DataIndex="test">
                        <Editor>
                            <ext:TextField ID="TextField1" runat="server" />
                        </Editor>
                    </ext:Column>
                </Columns>
            </ColumnModel>
            <BottomBar>
                <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="3" />
            </BottomBar>
            <Plugins>
                <ext:GridPanelMaintainScrollPositionOnRefresh ID="GridPanelMaintainScrollPositionOnRefresh1"
                    runat="server">
                </ext:GridPanelMaintainScrollPositionOnRefresh>
                <ext:GridFilters runat="server" ID="GridFilters1">
                    <Filters>
                        <ext:StringFilter DataIndex="test">
                        </ext:StringFilter>
                    </Filters>
                </ext:GridFilters>
            </Plugins>
        </ext:GridPanel>
        </form>
    </body>
    </html>
  6. #6
    Please set up Local="true" for a GridFilters.
  7. #7

    Modified Grid Data not Retains when navigating through page

    Hi Daniil,

    as you explained i had set the Local="true" for the Grid Filters,
    now what happens is, i have a code to add new records to the Grid using gridPanel.insertRecord(1); the row is added and the Grid Column filter which i had applied gets cleared .

    e.g: I have a Grid with 20 rows, i apply Grid Filter matching Column1 = "10", now i am able to see only 1 record in the Grid, then i add a new row using the function gridPanel.insertRecord(0); now the grid displays with 21 records (including the one i had added now). If i set the Property of GridFilter Local="false" the filter gets retained.

    Pls help me on this.
  8. #8
    I think you need to re-apply filters after you add a new record.
    grid.getStore().filterBy(grid.filters.getRecordFilter());
  9. #9

    Insert Record has problem when run with Filter

    The new record will not contain any values (in columns) when i Insert a Reord, So It is not included in the filtered records and not displayed in the grid after I tried to apply the filter next to the insert statement AS YOU MENTIONED.. This is very urgent . kindy give me a solution asap.
    
    gridPanel.insertRecord(1);
    gridPanel.store.filterBy(gridPanel.getFilterPlugin().buildQuery(gridPanel.getFilterPlugin().getFilterData()));
    Quote Originally Posted by Daniil View Post
    I think you need to re-apply filters after you add a new record.
    grid.getStore().filterBy(grid.filters.getRecordFilter());
  10. #10
    The code I suggested differs from the one you posted.

    Well, if the filters excludes a new record, you should:

    1. Reset the filters.

    or

    2. Make this record to be not excluded by the filters.
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] Modified behavior on grid
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Apr 30, 2012, 11:07 AM
  2. Replies: 1
    Last Post: Feb 03, 2012, 2:36 PM
  3. Replies: 1
    Last Post: Jul 21, 2011, 5:38 PM
  4. [CLOSED] Grouping doesn't group entire grid data...just current page.
    By rthiney in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Mar 05, 2010, 2:34 PM
  5. [CLOSED] Keyboard support in navigating Editor Grid Panel
    By jchau in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 15, 2009, 4:14 PM

Posting Permissions