最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jqgrid 編輯添加功能詳細(xì)解析

 更新時(shí)間:2013年11月08日 10:10:35   作者:  
本文是對(duì)jqgrid 編輯添加功能進(jìn)行了詳細(xì)的介紹,需要的朋友可以過(guò)來(lái)參考下,希望對(duì)大家有所幫助

ColModel 是jqGrid里最重要的一個(gè)屬性,設(shè)置表格列的屬性。

用法:

Java代碼 :

復(fù)制代碼 代碼如下:

jQuery("#gridid").jqGrid({  
...  
   colModel: [ {name:'name1', index:'index1'...}, {...}, ... ],  
..  
}); 

屬性  數(shù)據(jù)類型  備注  默認(rèn)值 
align  string  定義單元格對(duì)齊方式;可選值:left, center, right.  left 
classes  string  設(shè)置列的css。多個(gè)class之間用空格分隔,如:'class1 class2' 。表格默認(rèn)的css屬性是ui-ellipsis  empty string 
datefmt  string  對(duì)日期列進(jìn)行格式化?!?”, ”-”, and ”.”都是有效的日期分隔符。y,Y,yyyy 年YY, yy 月m,mm for monthsd,dd 日.  ISO Date (Y-m-d) 
defval  string  查詢字段的默認(rèn)值  空 
editable  boolean  單元格是否可編輯  false 
editoptions  array  對(duì)列進(jìn)行編輯時(shí)設(shè)置的一些屬性  empty array 
editrules  array  對(duì)于可編輯單元格的一些額外屬性設(shè)置  empty array 
edittype  string  可以編輯的類型。可選值:text, textarea, select, checkbox, password, button, image and file.  text 
fixed  boolean  列寬度是否要固定不可變  false 
formoptions  array  對(duì)于form進(jìn)行編輯時(shí)的屬性設(shè)置  empty 
formatoptions  array  對(duì)某些列進(jìn)行格式化的設(shè)置  none 
formatter  mixed  對(duì)列進(jìn)行格式化時(shí)設(shè)置的函數(shù)名或者類型  none 
hidedlg  boolean  是否顯示或者隱藏此列  false 
hidden  boolean  在初始化表格時(shí)是否要隱藏此列  false 
index  string  當(dāng)排序時(shí)定義排序字段名稱的索引,參數(shù)名為sidx  empty string 
jsonmap  string  定義了返回的json數(shù)據(jù)映射  none 
key  boolean  當(dāng)從服務(wù)器端返回的數(shù)據(jù)中沒(méi)有id時(shí),將此作為唯一rowid使用,默認(rèn)只能有一個(gè)id屬性  false 
label  string  如果colNames為空則用此值來(lái)作為列的顯示名稱,如果都沒(méi)有設(shè)置則使用name 值  none 
name  string  必輸項(xiàng),表格列的名稱,所有關(guān)鍵字,保留字都不能作為名稱使用包括subgrid, cb and rn.  Required 
resizable  boolean  是否可以被resizable  true 
search  boolean  在搜索模式下,定義此列是否可以作為搜索列  true 
searchoptions  array  設(shè)置搜索參數(shù)  empty 
sortable  boolean  是否可排序  true 
sorttype  string  用在當(dāng)datatype為local時(shí),定義搜索列的類型,可選值:int/integer - 對(duì)integer排序float/number/currency - 排序數(shù)字date - 排序日期text - 排序文本  text 
stype  string  定義搜索元素的類型  text 
surl  string  搜索數(shù)據(jù)時(shí)的url  empty string 
width  number  默認(rèn)列的寬度,只能是象素值,不能是百分比  150 
xmlmap  string  定義當(dāng)前列跟返回的xml數(shù)據(jù)之間的映射關(guān)系  none 
unformat  function  ‘unformat'單元格值  null 

源碼中添加

復(fù)制代碼 代碼如下:

editurl:'index.php?do=do_edit',
     addurl:'index.php?do=do_add',
                    datatype: 'xml',
                    mtype: 'GET',
                    colNames:['ID', '任務(wù)名稱', '所屬類'
                    colModel :[
                        {name:'taskid', index:'taskid', width:100,align:'center',searchoptions:{sopt:['eq','ne','lt','le','gt','ge']}},
      {name:'taskname', index:'taskname', width:100, align:'center',editable:true},
      {name:'classid', index:'classid', width:100, align:'center',editable:true,edittype:'select',editoptions: {
       value: '1:事務(wù);2:非事務(wù)'},editselected:'classid'
},

                    ],


添加editable后 添加也是同樣有效的;

搜索
eq 等于( = )
ne 不等于( <> )
lt 小于( < )
le 小于等于( <= )
gt 大于( > )
ge 大于等于( >= )
bw 開始于 ( LIKE val% )
bn 不開始于 ( not like val%)
in 在內(nèi) ( in ())
ni 不在內(nèi)( not in ())
ew 結(jié)束于 (LIKE %val )
en 不結(jié)束于
cn 包含 (LIKE %val% )
nc 不包含

相關(guān)文章

最新評(píng)論

栾川县| 塘沽区| 旌德县| 林甸县| 嘉兴市| 新蔡县| 安徽省| 当涂县| 西青区| 西乡县| 扎兰屯市| 广水市| 清涧县| 双桥区| 平安县| 宜兰市| 巨鹿县| 高平市| 仁化县| 额济纳旗| 尼勒克县| 尚志市| 博乐市| 宁国市| 马关县| 江山市| 察雅县| 胶州市| 安岳县| 东海县| 政和县| 乡城县| 望都县| 寿光市| 崇仁县| 马山县| 浦县| 行唐县| 松江区| 神农架林区| 连南|