Jquery数据表无效的Json响应错误

时间:2016-07-20 19:14:31

标签: jquery json model-view-controller datatables

这是我获取数据的动作结果。我不知道为什么一切都很好看。

public ActionResult loadProjectData()
    {

        var data = harvestApi.GetAllProject2().OrderBy(a => a.created_at).ToList() ;

        return Json(new { data = data }, JsonRequestBehavior.AllowGet);
    }

这是我的DataTable功能

$(document).ready(function () {
            $('#myTable').DataTable({
                "ajax": {
                    "url": "/project/loadProjectData",
                    "type": "GET",
                    "datatype": "json",

                },
                "iDisplayLength": 100,

                "columns": [
                        {
                            "data": "harvestLink", "autoWidth": true, "bSortable": true, "mRender": function (data, type, full) {
                                return '<a targevt="_blank" href=' + data +
                                     '>' + full.name + '</a>';

                            }
                        },


                        {
                            "data": "Client_Id", "autoWidth": true, "bSortable": true, "mRender": function (data, type, full) {
                                return '<a target="_blank" href=' +
                                     '@Url.Action("Customercard", "Customer")?id=' + data +
                                     '>' + full.c+ '</a>';
                            },
                        },
           ]

                });
              });

JSON: JSON

0 个答案:

没有答案