PDA

View Full Version : [CLOSED] GridPanel Store with RemotePaging



Timothy
May 07, 2012, 8:55 PM
Hello,

Just wonder what happened to the "start" parameter on the GridPanel Store with RemotePaging enabled. Here is my example:



@Html.X().GridPanel()
.Icon(Icon.Group)
.Height(250)
.Title("Users")
.Store(store =>
store.Add(Html.X().Store()
.ID("Users")
.PageSize(1)
.RemotePaging(true)
.RemoteSort(true)
.Parameters(parameters =>
{
parameters.Add(new StoreParameter
{
Name = "limit",
Value = "1"
} );

parameters.Add(new StoreParameter
{
Name = "start",
Value = "0"
} );

parameters.Add(new StoreParameter
{
Name = "dir",
Value = "ASC"
} );

parameters.Add(new StoreParameter
{
Name = "sort",
Value = "Email"
} );
} )
.Model(model =>
model.Add(Html.X().Model()
.Fields(fields =>
{
fields.Add(Html.X().ModelField()
.Name("Id")
);

fields.Add(Html.X().ModelField()
.Name("Name")
.Type(ModelFieldType.String)
);

fields.Add(Html.X().ModelField()
.Name("Email")
);
} )
)
)
.Proxy(proxy =>
proxy.Add(Html.X().AjaxProxy()
.Reader(reader =>
reader.Add(Html.X().JsonReader()
.IDProperty("Id")
.Root("data")
.TotalProperty("total")
)
)
.Url(Url.Action("Get", "User", new { Area = "Management" } ) )
)
)
)
)
.BottomBar(bar =>
bar.Add(Html.X().PagingToolbar()
.StoreID("Users")
)
)
.ColumnModel(models =>
{
models.Add(Html.X().Column()
.DataIndex("Name")
.Flex(1)
.Text("Name")
);
models.Add(Html.X().Column()
.DataIndex("Email")
.Text("Email")
.Width(500)
);
} )
.SelectionModel(model =>
model.Add(Html.X().RowSelectionModel())
)
)


When I use the paging, "start" never changes from "0". However, there is a new parameter called "page" which seems to be sent along.

Was this "start" parameter removed?

Any suggestion would be greatly appreciated.

Cheers,
Timothy

Daniil
May 08, 2012, 10:21 AM
Hi,

Now you should not set up these parameters explicitly. They are managed automatically.

Please look at this example:
http://examples2.ext.net/#/GridPanel/Plugins/GridFilters_Remote/

There are no start, limit, sort and direction parameters, but the things appear to be functioned correctly.
http://examples2.ext.net/#/GridPanel/Plugins/GridFilters_Remote/

And yes, the additional parameter "page" has been appeared.

Timothy
May 08, 2012, 12:42 PM
Thanks for the clarification, please close.

Cheers,
Timothy