ComponentOne MVC Flexgrid数据绑定

时间:2015-09-02 18:53:13

标签: c# componentone wijmo

我在页面上有一个Flexgrid。我想做一些自定义过滤。我创建了一个Filter ActonResult。在其中我创建了过滤数据集。如何将数据发送回页面?如果我返回一个视图,我没有得到任何更新的数据。有没有办法将数据发送回Json中的页面并通过javascript更新?

2 个答案:

答案 0 :(得分:1)

我建议您使用jQuery.ajax。您可以通过url属性调用操作,在“成功”中获取已过滤的数据。回调并将返回的数据设置为FlexGrid的itemssource。

更多信息herehere

答案 1 :(得分:0)

我认为您可以使用ReadActionUrl来实现它。

在Controller中,您可以编写以下类似的Filter操作。

public ActionResult Filter([C1JsonRequest] CollectionViewRequest<Category> requestData)
        {
            return this.C1Json(CollectionViewHelper.Read(requestData, **db.Categories.ToList().Skip(3)**));
        }

在Viewer中,您应该使用ReadActionUrl属性

@(Html.C1().FlexGrid<Category>().Bind(Url.Action("Filter"))) //Use Bind method to set the ReadActionUrl property.