【问题标题】:simple jqGrid implementation doesn't work简单的 jqGrid 实现不起作用
【发布时间】:2010-03-04 01:19:23
【问题描述】:
$("#list2").jqGrid({
            mtype: 'GET',
            datatype: 'Arche.Search.ItemT',
            colNames:['test1','test2', 'test3'],
            colModel:[
                {name:'ID',index:'ID', width:100,align:"center",key:true},
                {name:'Brand',index:'Name', width:90},
                {name:'BrandID',index:'CurrentPrice asc, invdate', width:100},
            ],
            rowNum:10,
            rowList:[10,20,30],
            pager: '#pager2',
            sortname: 'id',
            viewrecords: true,
            sortorder: "desc",
            caption:"TEST jqGRID",
            multiselect: false
        });

        var datarow = {ID:"99",Brand:"2007-09-01",BrandID:"test3"};
        //$("#list2").addRowData(0,datarow);   <== this works very well.
        $("#list2")[0].addJSONData("{total: 1, page: 1, records: 1, rows : [ {id: '1', cell:['1', '2007-10-01', 'test']} ] }");

代码

$("#list2")[0].addJSONData("{total: 1, page: 1, records: 1, rows : [ {id: '1', cell:['1', '2007-10-01', 'test']} ] }");

在 jqGrid 上不显示任何内容。

而且也没有错误。

我真的找不到这不起作用的原因..

我还有 1 个问题。

问题是 JSON.parse() 在我的情况下是语法错误。

【问题讨论】:

    标签: json jqgrid


    【解决方案1】:

    显然 addJSONData 存在问题:jqgrid-addjsondata-asp-net-2-0-ws

    您确定addRowData 不适合您吗?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-11
      • 2021-05-18
      • 2018-11-14
      • 2017-05-19
      相关资源
      最近更新 更多