Home >Web Front-end >JS Tutorial >Jqgrid set all selection (select) and get the value of the selected row sample code

Jqgrid set all selection (select) and get the value of the selected row sample code

PHP中文网
PHP中文网Original
2016-05-16 17:06:292093browse

1. Add multiselect: true

2. Get the value of the selected row

The code is as follows:

var rowData = jQuery('#List').jqGrid('getGridParam','selarrrow');
    if(rowData.length) 
    {
        for(var i=0;i<rowData.length;i++)
        {
           var name= jQuery(&#39;#List&#39;).jqGrid(&#39;getCell&#39;,rowData[i],&#39;name&#39;);//name是colModel中的一属性
           alert(name);
        }
    }


3. Set a row to be selected
jQuery('#List').jqGrid('setSelection','5');

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn