日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

jqGrid ColModel Options

發布時間:2025/5/22 编程问答 44 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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){
var temp = “<img src=’${ctx}/jquery-ui-1.7.2.custom/css/img/”
if(cellvalue==1){
temp = temp +”user-white.png”;
} else if(cellvalue==2){
temp = temp +”user-white-female.png”;
} else {
temp = temp + “user-silhouette.png”;
}
temp = temp + “‘ border=’0′?/>”
return temp;
}},//返回性別的圖標。

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的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。