如何将JSON格式数据绑定到jqGrid

时间:2013-05-09 09:33:28

标签: c# html asp.net json jqgrid

嗨,我希望将我的JSON格式数据绑定到jqGrid。

{
    "total_entries": 2,
    "current_page": 1,
    "total_pages": 1,
    "per_page": 2,
    "items": [
        {
            "workspace": {
                "background_color": "#ffedd3",
                "data_room": false,
                "default_sort": "alphabetical",
                "default_view": "list",
                "id": 330201,
                "name": "MyWorkSpaceNew",
                "updated_at": "2013-05-08T05:54:25-07:00",
                "root_folder_id": 166325721,
                "owner_id": 991101,
                "is_owner": true,
                "effective_role": "Administrator",
                "audit_trail": true,
                "require_agreement": false,
                "agreement_accepted": false
            }
        },
        {
            "workspace": {
                "background_color": "white",
                "data_room": true,
                "default_sort": "alphabetical",
                "default_view": "list",
                "id": 337896,
                "name": "NEWTEST",
                "updated_at": "2013-05-08T04:58:22-07:00",
                "root_folder_id": 174971806,
                "owner_id": 991101,
                "is_owner": true,
                "effective_role": "Administrator",
                "audit_trail": true,
                "require_agreement": false,
                "agreement_accepted": false
            }
        }
    ]
}

在我的控制器页面中,我得到的是这样的值。我的控制器代码是

public ActionResult OauthVerifier()
    {
        OContext = OAuthContext.Current;
        if (OContext != null)
        {
            OContext.EndAuthenticationAndRegisterTokens();
            OContext.GetAccessToken();
            var responseText = OContext.GetProfileResponse();
            ViewBag.message = responseText;
            return Json(responseText, JsonRequestBehavior.AllowGet);

        }

        return View();
    }

responsetxt我正在获取JSON格式数据,我将如何将其绑定到jqGrid。我对jqGrid一无所知。

0 个答案:

没有答案