jqGrid的单选设置

 

jqgrid需要设置成选项固定选中,代码如下

onSelectRow: function (id) {
                    if (ids.length <= 0)
                        ids = $(this).jqGrid('getGridParam', 'selarrrow');     //获取选中行的ID
                    if (id && ids.length > 1) {
                        $(ids).each(function (i) {
                            if (ids[i].toString() != id.toString())
                                $(this).jqGrid('setSelection', ids[i].toString());
                        });
                    }
                    return true;                                                          //返回已选中,即可固定选项
                    //ids = $('#gridTable').jqGrid('getGridParam', 'selarrrow');
                },

你可能感兴趣的:(js,jqgrid)