PDA

View Full Version : [OPEN] [#348] Infinity Scrolling



thchuong
Sep 17, 2013, 11:31 PM
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,

Daniil
Sep 18, 2013, 11:50 AM
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())
)

thchuong
Sep 19, 2013, 11:11 AM
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,

Daniil
Sep 19, 2013, 2:17 PM
OK. Please demonstrate the GetUsers controller action.

thchuong
Sep 19, 2013, 3:44 PM
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;
}
}

Daniil
Sep 19, 2013, 4:04 PM
Thank you. It looks correct.

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

but it does not work.

thchuong
Sep 19, 2013, 8:08 PM
Thank you. It looks correct.

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

Hi,

here it is

6917

Daniil
Sep 20, 2013, 4:36 AM
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.

thchuong
Sep 23, 2013, 5:21 AM
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.