jqGrid ColModel Options
ColModel 是jqGrid里最重要的一個屬性,設置表格列的屬性。
?
?
| 屬性 | 數據類型 | 備注 | 默認值 |
| align | string | left, center, right. | left |
| classes | string | 設置列的css。多個class之間用空格分隔,如:'class1 class2'?。表格默認的css屬性是ui-ellipsis | empty string |
| datefmt | string | ”/”, ”-”, and ”.”都是有效的日期分隔符。y,Y,yyyy?年YY, yy?月m,mm for monthsd,dd?日. | ISO Date (Y-m-d) |
| defval | string | 查詢字段的默認值 | 空 |
| editable | boolean | 單元格是否可編輯 | false |
| editoptions | array | 編輯的一系列選項。{name:’__department_id’,index:’__department_id’,width:200,editable:true,edittype:’select’,editoptions: {dataUrl:”${ctx}/admin/deplistforstu.action”}},這個是演示動態從服務器端獲取數據。 | empty |
| editrules | array | 編輯的規則{name:’age’,index:’age’, width:90,editable:true,editrules: {edithidden:true,required:true,number:true,minValue:10,maxValue:100}},設定?年齡的最大值為100,最小值為10,而且為數字類型,并且為必輸字段。 | empty |
| edittype | string | 可以編輯的類型。可選值:text, textarea, select, checkbox, password, button, image and file. | text |
| fixed | boolean | 列寬度是否要固定不可變 | false |
| formoptions | array | 對于form進行編輯時的屬性設置 | empty |
| formatoptions | array | 對某些列進行格式化的設置 | none |
| formatter | mixed | 對列進行格式化時設置的函數名或者類型 {name:’sex’,index:’sex’, align:’center’,width:60,editable:true,edittype:’select’,editoptions: {value:’0:待定;1:男;2:女’},formatter:function(cellvalue, options, rowObject){ | none |
| hidedlg | boolean | 是否顯示或者隱藏此列 | false |
| hidden | boolean | 在初始化表格時是否要隱藏此列 | false |
| index | string | 索引。其和后臺交互的參數為sidx | empty |
| jsonmap | string | 定義了返回的json數據映射 | none |
| key | boolean | 當從服務器端返回的數據中沒有id時,將此作為唯一rowid使用只有一個列可以做這項設置。如果設置多于一個,那么只選取第一個,其他被忽略 | false |
| label | string | 如果colNames為空則用此值來作為列的顯示名稱,如果都沒有設置則使用name?值 | none |
| name | string | 表格列的名稱,所有關鍵字,保留字都不能作為名稱使用包括subgrid, cb and rn. | Required |
| resizable | boolean | 是否可以被resizable | true |
| search | boolean | 在搜索模式下,定義此列是否可以作為搜索列 | true |
| searchoptions | array | 設置搜索參數 | empty |
| sortable | boolean | 是否可排序 | true |
| sorttype | string | 用在當datatype為local時,定義搜索列的類型,可選值:int/integer -?對integer排序float/number/currency -?排序數字date -?排序日期text -?排序文本 | text |
| stype | string | 定義搜索元素的類型 | text |
| surl | string | 搜索數據時的url | empty |
| width | number | 默認列的寬度,只能是象素值,不能是百分比 | 150 |
| xmlmap | string | 定義當前列跟返回的xml數據之間的映射關系 | none |
| unformat | function | ‘unformat’單元格值 | null ? ? |
轉載于:https://www.cnblogs.com/cleverJoe/p/3848821.html
總結
以上是生活随笔為你收集整理的jqGrid ColModel Options的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: TWaver版3D化学元素周期表
- 下一篇: jQuery操作input改变value