1
    url: base_url + 'index.php/user/userlist',
    datatype: "json",
    colNames: [
        'id', 'First Name', 'Lasr Name', 'Email', 'Gender', 'Birthday', 'Address1', 'Address2', 'City', 'State',
        'Country', 'Pin No', 'Mobile No', 'Tel No', 'Pan No', 'Status'
    ],

    colModel:[
    {name:'id',index:'id', width:55},
                {name:'firstname',index:'firstname', width:55},
                {name:'lastname',index:'lastname', width:55},
                {name:'email',index:'email', width:55},   
                {name:'gender',index:'gender', width:55}, 
                {name:'birthday',index:'birthday', width:55},
                {name:'address1',index:'address1', width:55},
                {name:'address2',index:'address2', width:55},
                {name:'city',index:'city', width:55},
                {name:'country',index:'country', width:55},
                {name:'state',index:'state', width:55},
                {name:'pin',index:'pin', width:55},
                {name:'mobileno',index:'mobileno', width:55},
                {name:'telno',index:'telno', width:55},
                {name:'pan',index:'pan', width:55},
                {name:'status',index:'status', width:55},
             ],

    viewrecords: true, //Shows the nice message on the pager

    shrinkToFit: true,
    height: 'auto', //I like auto, so there is no blank space between. Using a fixed height can mean either a scrollbar or a blank space before the pager



    pager: '#userlistpager',
    sortname: 'firstname',
    rowNum: 10,
    rowList: [ 10, 20,30],


    rownumbers: true,
    sortorder: "asc",

我的 Json 结果

{
"page": "1",
"total": 1,
"records": "8",
"rows": [{
    "id": "1",
    "cell": [
        "1",
        "naresh",
        "kumar",
        "sungonaresh@gmail.com",
        "",
        "0000-00-00",
        "gandji nage",
        "hosur",
        "banglore",
        "India",
        "",
        "0",
        "2147483647",
        "2147483647",
        "46",
        "1"
    ]
}, {
    "id": "2",
    "cell": [
        "2",
        "naresh",
        "kumar",
        "sungonaresh@gmail.com",
        "",
        "",
        "gandji nage",
        "hosur",
        "banglore",
        "India",
        "",
        "0",
        "2147483647",
        "2147483647",
        "46",
        "1"
    ]
}, {
    "id": "6",
    "cell": [
        "6",
        "test",
        "last",
        "kumarnareshmay@gmail.com",
        "male",
        "2012-78-45",
        "sdf",
        "sdf",
        "sdf",
        "India",
        "Chandigarh",
        "0",
        "234",
        "234",
        "234",
        "1"
    ]
}]

}

ID 是唯一的,但我无法选择 jqgrid 中的行

我看到jqGrid - 无法选择行 - 无法调用未定义 帖子的方法 'indexOf' 它告诉如果 id 是唯一的,我们可以选择行。但就我而言,我不能..

提前致谢 。任何帮助是极大的赞赏

4

1 回答 1

1

我认为您的其他一些代码可能与此代码冲突,因为您提供的代码可以正常工作。您的示例http://jsfiddle.net/kVex2/ 我希望您的代码正确关闭。它可能与记录有关,因为您只有 3 条记录。

 "records": "8",
于 2013-08-24T10:40:46.917 回答