Here when a dropdown change the filter value (what we are selected ) will pass to the action result
Script
$(".selectRequestType").change(function () {
$('#jqgRequests').setGridParam({ postData: { FilterValue: $(this).val() } }).trigger('reloadGrid', [{ page: 1 }]);
});
Action Result
[AcceptVerbs(HttpVerbs.Post)]
public JsonResult LoadRequest(JqGridRequest request, PostDataViewModel postData)
{
}
public class PostDataViewModel
{
public string FilterValue { get; set; }
}
Script
$(".selectRequestType").change(function () {
$('#jqgRequests').setGridParam({ postData: { FilterValue: $(this).val() } }).trigger('reloadGrid', [{ page: 1 }]);
});
Action Result
[AcceptVerbs(HttpVerbs.Post)]
public JsonResult LoadRequest(JqGridRequest request, PostDataViewModel postData)
{
}
public class PostDataViewModel
{
public string FilterValue { get; set; }
}
No comments:
Post a Comment