[OPEN] [#348] Infinity Scrolling

  1. #1

    [OPEN] [#348] Infinity Scrolling

    Hi,

    I follows sample instruction to make a grid panel with Infinity Scrolling but it does not work.

    @(Html.X().GridPanel()      .Title("Users")
          .Width(600)
          .Height(350)
          .Store(Html.X().Store()
          .Buffered(true)
          .PageSize(25)
          .LeadingBufferZone(75)
                     .Model(Html.X().Model()
                                .Fields(
                                    new ModelField("Id", ModelFieldType.String),
                                    new ModelField("Username", ModelFieldType.String),
                                    new ModelField("ShownName", ModelFieldType.String),
                                    new ModelField("Administrator", ModelFieldType.Boolean)
                                )
                     )
                      .Proxy(Html.X().AjaxProxy()
                      .Url(Url.Action("GetUsers"))
                    .Reader(Html.X().JsonReader().Root("data")))
          )
          .ColumnModel(
              Html.X().Column().Text("Username").DataIndex("Username").Width(100),
              Html.X().Column().Text("Shown Name").DataIndex("ShownName").Flex(1),
              Html.X().CheckColumn().Text("Administrator").DataIndex("Administrator").Width(100)
          )
          )
    Could you please tell me what I miss?

    Thanks,
    Last edited by Daniil; Sep 20, 2013 at 4:36 AM. Reason: [OPEN] [#348]
  2. #2
    Hi @thchuong,

    First of all, please clarify do you really need a buffered Store? How many records is it supposed to deal with?

    Maybe, buffered rendering is good enough for you.
    @(Html.X().GridPanel()
        .Plugins(Html.X().BufferedRenderer())
    )
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @thchuong,

    First of all, please clarify do you really need a buffered Store? How many records is it supposed to deal with?

    Maybe, buffered rendering is good enough for you.
    @(Html.X().GridPanel()
        .Plugins(Html.X().BufferedRenderer())
    )
    Hi,

    It is simple. I don't want to use paging by page, I prefer scrolling for ease of use; remote data not local data

    Thanks,
  4. #4
    OK. Please demonstrate the GetUsers controller action.
  5. #5
    Quote Originally Posted by Daniil View Post
    OK. Please demonstrate the GetUsers controller action.
    Hi,

    Here it is

            public ActionResult GetUsers(int start, int limit)        
    {
                return this.Store(Users.GetUsers(start, limit), 5000);
            }
        public class User
        {
            public int Id { get; set; }
            public string Username { get; set; }
            public string Password { get; set; }
            public string ShownName { get; set; }
            public bool Administrator { get; set; }
        }
    
    
        public class Users
        {
            public static IEnumerable GetUsers(int start, int limit)
            {
                var result = new List<User>();
    
    
                for (var idx = start + 1; idx < start + limit; idx++)
                {
                    result.Add(new User
                    {
                        Id = idx,
                        Username = string.Format("user {0}", idx + 1),
                        ShownName = string.Format("Shown name {0}", idx + 1),
                        Administrator = idx % 2 == 0 ? true : false
                    });
                }
    
    
                return result;
            }
        }
  6. #6
    Thank you. It looks correct.

    Could you, please, elaborate the following? What exactly does happen?
    Quote Originally Posted by thchuong View Post
    but it does not work.
  7. #7
    Quote Originally Posted by Daniil View Post
    Thank you. It looks correct.

    Could you, please, elaborate the following? What exactly does happen?
    Hi,

    here it is

    Click image for larger version. 

Name:	infinity.png 
Views:	20 
Size:	52.6 KB 
ID:	6917
  8. #8
    Thank you, it is a bug. Reported to Sencha.
    http://www.sencha.com/forum/showthread.php?272262

    Created an Issue to track it.
    https://github.com/extnet/Ext.NET/issues/348

    Fixed in the SNV trunk, revision #5366.

    Please update or use:
    .CustomConfig(cc => cc.Add(new { pageSize = 25 }))
    instead of
    .PageSize(25)
    Please note that the problem occurs with 25 only. It would be OK with 24, 26 or any other.
  9. #9
    Quote Originally Posted by Daniil View Post
    Thank you, it is a bug. Reported to Sencha.
    http://www.sencha.com/forum/showthread.php?272262

    Created an Issue to track it.
    https://github.com/extnet/Ext.NET/issues/348

    Fixed in the SNV trunk, revision #5366.

    Please update or use:
    .CustomConfig(cc => cc.Add(new { pageSize = 25 }))
    instead of
    .PageSize(25)
    Please note that the problem occurs with 25 only. It would be OK with 24, 26 or any other.
    Hi Danill,

    Nice to hear that. Thank you.

Similar Threads

  1. [CLOSED] Scrolling ListFilter
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Sep 05, 2012, 6:07 PM
  2. Replies: 3
    Last Post: May 25, 2009, 3:15 AM
  3. GridPanel expanding to infinity in firefox
    By maxdiable in forum 1.x Help
    Replies: 0
    Last Post: May 23, 2009, 8:16 AM
  4. Firefox, Grids expanding to infinity
    By DasPhansom in forum 1.x Help
    Replies: 2
    Last Post: May 23, 2009, 8:12 AM

Posting Permissions