【问题标题】:jqGrid - cant select rows even id is uniquejqGrid - 即使id是唯一的也不能选择行
【发布时间】:2013-08-24 09:31:38
【问题描述】:
    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 - cant select rows - Cannot call method 'indexOf' of undefined 发布它告诉如果 id 是唯一的,我们可以选择该行。但就我而言,我不能..

提前致谢。非常感谢任何帮助

【问题讨论】:

  • 网格渲染是否正确?你能展示一下 jqGrid 的整个初始化代码吗?

标签: jquery jqgrid


【解决方案1】:

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

 "records": "8",

【讨论】:

    猜你喜欢
    • 2016-04-15
    • 2017-11-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-09
    相关资源
    最近更新 更多