开发者

jqgrid/mvc 3 - How to call grid in controller?

I'm new to jqgrid. It's may be silly question, but please help me.

I want to export data to excel file, and I watch demo on http://www.trirand.net/demoaspnetmvc.aspx , it's already support it. However I defined grid in Views, not in Model like the demo:

   $(document).ready(function () {
        jQuery("#list").jqGrid({{
            url: '/documents/List',{
            datatype: 'json',{
            mtype: 'GET',{
            ......

I wonder if there's开发者_StackOverflow中文版 a way to call this grid from controller, or how to name and use it like variable?

Thank in advance


You cannot call grid from your controller. Jqgrid extension just renders data on a client in a way you specify it, you have no access to it from server-side code.
If you take closer look on example which you provide, authors pass grid options in request and bind new grid object on server, then export data from this object. You need to do the same.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜