Naresh Kumar
Naresh Kumar

Reputation: 624

jqGrid - cant select rows even id is unique

    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",

my Json result

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

}

Id is unique but i cant select the row in jqgrid

i saw the jqGrid - cant select rows - Cannot call method 'indexOf' of undefined post it tell that if id is unique we can select the row. but in my case i cant..

Thanks in advance . Any help is greatly appreciated

Upvotes: 1

Views: 898

Answers (1)

TheCodeDestroyer
TheCodeDestroyer

Reputation: 762

I think some of your other code might be conflicting with this code as from what you provided works ok. Your example http://jsfiddle.net/kVex2/ I hope your code is correctly closed. It might have something to do with records as you only have 3 records.

 "records": "8",

Upvotes: 1

Related Questions