How to get a jqGrid selected row cells value

后端 未结 6 660
忘掉有多难
忘掉有多难 2020-12-08 13:40

Does anyone know how to get the cells value of the selected row of JQGrid ? i m using mvc with JQGrid, i want to access the value of the hidden column of the selected row ?<

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-08 14:06

    Just Checkout This :

    Solution 1 :

    In Subgrid Function You have to write following :

    var selectid = $(this).jqGrid('getCell', row_id, 'id');
    alert(selectid);
    

    Where row_id is the variable which you define in subgrid as parameter. And id is the column name which you want to get value of the cell.

    Solution 2 :

    If You Get Jqgrid Row Id In alert Then set your primary key id as key:true In ColModels. So You will get value of your database id in alert. Like this :

    {name:"id",index:"id",hidden:true, width:15,key:true, jsonmap:"id"},
    

提交回复
热议问题