ComboBox lose value with remote paging

  1. #1

    ComboBox lose value with remote paging

    Hi,

    I want to create a combobox with remote paging but i found a problem that the comboBox lose the selected value when i pass to next page.
    I tested the solution in this link https://www.sencha.com/forum/showthr...-remote-paging
    but didn't work with me.

    Please help me.
  2. #2
    Hi @GRISSA,

    Welcome to the Ext.NET forums!

    Yes, it is an issue in Ext.NET v2.
    https://github.com/extnet/Ext.NET/issues/318

    But I could not reproduce it in v3 with the sample below. Can you reproduce?

    Example
    <%@ Page Language="C#" %>
    
    <%@ Import Namespace="System.Collections.Generic" %>
    
    <script runat="server">
        public List<object> MyData = new List<object> 
        { 
            new { test = "test1" },
            new { test = "test2" },
            new { test = "test3" },
            new { test = "test4" },
            new { test = "test5" },
            new { test = "test6" },
            new { test = "test7" },
            new { test = "test8" },
            new { test = "test9" }
        };
    
        protected void Store_ReadData(object sender, StoreReadDataEventArgs e)
        {
            List<object> data = this.MyData;
            var limit = e.Limit;
            if ((e.Start + e.Limit) > data.Count)
            {
                limit = data.Count - e.Start;
            }
            List<object> rangeData = (e.Start < 0 || limit < 0) ? data : data.GetRange(e.Start, limit);
            e.Total = data.Count;
            (sender as Store).DataSource = rangeData;
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v3 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:ComboBox 
                runat="server" 
                PageSize="3" 
                DisplayField="test" 
                Width="300">
                <Store>
                    <ext:Store runat="server" OnReadData="Store_ReadData" PageSize="3">
                        <Model>
                            <ext:Model runat="server">
                                <Fields>
                                    <ext:ModelField Name="test" />
                                </Fields>
                            </ext:Model>
                        </Model>
                        <Proxy>
                            <ext:PageProxy>
                                <Reader>
                                    <ext:JsonReader />
                                </Reader>
                            </ext:PageProxy>
                        </Proxy>
                    </ext:Store>
                </Store>
            </ext:ComboBox>
        </form>
    </body>
    </html>

Similar Threads

  1. SqlDataSource remote paging
    By asics167 in forum 2.x Help
    Replies: 7
    Last Post: Oct 28, 2013, 12:57 PM
  2. GridPanel Remote Paging with SqlDatasource
    By Aod47 in forum 1.x Help
    Replies: 1
    Last Post: Oct 25, 2013, 6:00 AM
  3. Replies: 11
    Last Post: Jun 13, 2012, 4:53 PM
  4. [CLOSED] Remote paging GridPanel
    By idrissb in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Jan 21, 2010, 11:17 AM
  5. [CLOSED] ComboBox Blur or Lose Focus
    By Steve in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 03, 2009, 3:55 AM

Posting Permissions