good morning everyone,
how are you? I am currently using the licensed version of Kendo UI Complete for ASP.NET MVC (Q2 2012) and trying to figure out the correct way to pass additional data parameters to the server using the Data() function of the grid.
Below is my setup for the Kendo UI Wrapper grid.
@(Html.Kendo().Grid<ViewModel>()
.Name("grdAllWebsites")
.Columns(columns =>
{
...
})
.DataSource(dataSource =>
{
dataSource.Ajax()
.Model(model =>
{
// DataKey
model.Id(o => o.Id);
})
.PageSize(10)
.Create(create => create.Action("Create", "Home").Data("CreateJS"))
})
.Pageable(paging =>
{
...
})
.Sortable(sortable =>
{
sortable.SortMode(GridSortMode.MultipleColumn);
})
.Filterable()
)
and here is my js function:
right now, i am using query string to pass additional data/parameters to the server but is there a better or correct way to pass the additional parameters to the server? I tried looking at the API documentation but there wasn't an example on a good/correct way to do this:
http://docs.kendoui.com/api/wrappers/aspnet-mvc/Kendo.Mvc.UI.Fluent/CrudOperationBuilder#datasystemstring
thank you very much for your help.
how are you? I am currently using the licensed version of Kendo UI Complete for ASP.NET MVC (Q2 2012) and trying to figure out the correct way to pass additional data parameters to the server using the Data() function of the grid.
Below is my setup for the Kendo UI Wrapper grid.
.Name("grdAllWebsites")
.Columns(columns =>
{
...
})
.DataSource(dataSource =>
{
dataSource.Ajax()
.Model(model =>
{
// DataKey
model.Id(o => o.Id);
})
.PageSize(10)
.Create(create => create.Action("Create", "Home").Data("CreateJS"))
})
.Pageable(paging =>
{
...
})
.Sortable(sortable =>
{
sortable.SortMode(GridSortMode.MultipleColumn);
})
.Filterable()
)
and here is my js function:
CreateJS: function (e) {
var args = arguments;
var subjectCode = $('#subjectCode').val();
var isActive = $('#isActive').val();
this.url += ("?subjectCode=" + subjectCode + "&isActive=" + isActive);
}
right now, i am using query string to pass additional data/parameters to the server but is there a better or correct way to pass the additional parameters to the server? I tried looking at the API documentation but there wasn't an example on a good/correct way to do this:
http://docs.kendoui.com/api/wrappers/aspnet-mvc/Kendo.Mvc.UI.Fluent/CrudOperationBuilder#datasystemstring
thank you very much for your help.