I have a Flexgrid on a page. I want to do some custom filtering. I created a Filter ActonResult. In it I have created the filtered dataset. How do I send the data back to the page? If I return a view I don't get any updated data. Is there a way to send the data back to the page in Json and update via javascript?
Asked
Active
Viewed 588 times
2 Answers
0
I think you can use the ReadActionUrl
to implement it.
In Controller, you can write the below similar Filter action.
public ActionResult Filter([C1JsonRequest] CollectionViewRequest<Category> requestData)
{
return this.C1Json(CollectionViewHelper.Read(requestData, **db.Categories.ToList().Skip(3)**));
}
And in Viewer, you should use ReadActionUrl property
@(Html.C1().FlexGrid<Category>().Bind(Url.Action("Filter"))) //Use Bind method to set the ReadActionUrl property.

Usman Maqbool
- 3,351
- 10
- 31
- 48

Ryan
- 1