亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

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

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

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

用法:

Java代碼 :

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

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

屬性  數(shù)據(jù)類型  備注  默認(rèn)值 
align  string  定義單元格對齊方式;可選值:left, center, right.  left 
classes  string  設(shè)置列的css。多個(gè)class之間用空格分隔,如:'class1 class2' 。表格默認(rèn)的css屬性是ui-ellipsis  empty string 
datefmt  string  對日期列進(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  對列進(jìn)行編輯時(shí)設(shè)置的一些屬性  empty array 
editrules  array  對于可編輯單元格的一些額外屬性設(shè)置  empty array 
edittype  string  可以編輯的類型。可選值:text, textarea, select, checkbox, password, button, image and file.  text 
fixed  boolean  列寬度是否要固定不可變  false 
formoptions  array  對于form進(jìn)行編輯時(shí)的屬性設(shè)置  empty 
formatoptions  array  對某些列進(jìn)行格式化的設(shè)置  none 
formatter  mixed  對列進(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ù)中沒有id時(shí),將此作為唯一rowid使用,默認(rèn)只能有一個(gè)id屬性  false 
label  string  如果colNames為空則用此值來作為列的顯示名稱,如果都沒有設(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 - 對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)文章

最新評論