Hi,
I’ve following method which I’m using to build data source
for Kendo UI grid. I want to set default page number like default page size but
I can’t see an option in DataSourceBuilder.
Any idea?
public static Action<DataSourceBuilder<T>>DataSourcer<T>(string action, string controller, int total, string area, string jsParamFuncName = "",
int? defaultPageSize = null)
where T : class
{
if
(!defaultPageSize.HasValue)
defaultPageSize = int.Parse(ApplicationConfigurationDataHelper.GetByKey(ApplicationConfigurationConstants.DefaultPageSize).Value);
return
dataSource => dataSource.Ajax().Read(read => {
read.Action(action,
controller, new { area });
if (!string.IsNullOrEmpty(jsParamFuncName))
{
read.Data(d => jsParamFuncName);
}
}) .Total(total)
.PageSize(defaultPageSize.Value)
.Events(e => e.Change(JsFunctionNameConstants.EmptyGridMessage));
}
I’ve following method which I’m using to build data source
for Kendo UI grid. I want to set default page number like default page size but
I can’t see an option in DataSourceBuilder.
Any idea?
public static Action<DataSourceBuilder<T>>DataSourcer<T>(string action, string controller, int total, string area, string jsParamFuncName = "",
int? defaultPageSize = null)
where T : class
{
if
(!defaultPageSize.HasValue)
defaultPageSize = int.Parse(ApplicationConfigurationDataHelper.GetByKey(ApplicationConfigurationConstants.DefaultPageSize).Value);
return
dataSource => dataSource.Ajax().Read(read => {
read.Action(action,
controller, new { area });
if (!string.IsNullOrEmpty(jsParamFuncName))
{
read.Data(d => jsParamFuncName);
}
}) .Total(total)
.PageSize(defaultPageSize.Value)
.Events(e => e.Change(JsFunctionNameConstants.EmptyGridMessage));
}