jqGrid 自定義搜索


<div id="mysearch"></div>

jQuery("#mysearch").filterGrid('#grid_id',options);

options:參數

參數

描述

默認值

gridModel

當為ture我們會使用colModel中的屬性構造查詢條件,所用到的參數:name, index, edittype, editoptions, search.還有一個參數:defval:查詢條件的默認值;surl:當edittype:'select'時獲取select數據的url,格 式:<select><option value='val1'> Value1 </option><option value='val2'> Value2 </option>…<option value='valn'> ValueN </option></select>

false

gridNames

gridModel為true時起效,設置查詢列的名稱

false

filterModel

gridModel為false時起效,格式:{label:'LableFild', name: 'colname', stype: 'select', defval: 'default_value', surl: 'someurl', sopt:{optins for the select}}。label:字段顯示名稱;name:列名;stype:輸入框類型,text或者select;surl:獲取select數據的地 址,要求的內容為html格式:<select><option value='val1'> Value1 </option><option value='val2'> Value2 </option>…<option value='valn'> ValueN </option></select>;sopt:同editoptions 

[]

formtype

定義表單如何被構造,'horizontal' or 'vertical'

 

autosearch

如果為true:當點擊回車鍵觸發查詢;當select值變化時觸發查詢

 

formclass

可以使用的css

filterform

tableclass

可以使用到table上的css

filtertable

buttonclass

按鈕上使用的css

filterbutton

searchButton

搜索按鈕

Search

clearButton

清空數據的按鈕

Clear

enableSearch

啟用禁用搜索按鈕

false

enableClear

啟用禁用清空按鈕

false

beforeSearch

搜索之前觸發的事件

null

afterSearch

搜索完成之后觸發的事件

null

beforeClear

清空數據之前觸發的事件

null

afterClear

清空數據之后觸發事件

null

url

搜索數據的url

‘’

marksearched

當為true時,每次查詢之后所有查詢的列都標記為可查詢列

true

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM