jqgrid中 colModel

1.colModel  属性说明:

   align: string  定义单元格对齐方式 有 left ,right,center ,默认值left

  cellattr: function   附加到当前单元格上的属性  这个方法有4个参数 rowId,val,rawobject,cm ,data

  示例: function (the raw object of the data row){  "style='color:red'"; }

  classes: string  当前列添加样式 如果不止一个 可以这操作 classes:'class1,class2' ,这个样式将应用到当前所有的列上

  datefmt:string 时间格式sorttype:date ,支持分割符号‘/’,'-',默认格式ISO Date (Y-m-d) 同时还有 年:y(yy),Y(YY),yyyy 月:m,mm, 天:d,dd

  defval: string  默认为搜索字段,用于自定义搜索初始化搜索

  editable:boolean 默认是false ,是否字段可编辑,自定义编辑

  editoptions:arry   编辑是的呈现方式 ,有checkbox text  textarea  这个还和edittype有关系 比如说password

  示例; checkbox   editoptions:{value:"Yes,No"}  select editoptions: { value: “FE:FedEx; IN:InTime; TN:TNT” }

         text   editoptions:{size:10,maxlength:15}  textarea: editoptions:{rows:"2",cols:"4"}

 editrules: arry   定义编辑的规则 如验证 最小值最大值 非空等   还可以自定义custom:true  并且设置这个函数custom_func :func

  示例: editrules:{edithidden:true, required:true,number:true, minValue:1,maxValue:100}

 edittype: string 编辑是的类型 默认类型text 可选值;text, textarea, select, checkbox, password, button, image ,file

 firstsortorder:string  列加载数据排序方式 如  asc  desc

 fixed:boolean  默认值false 如果设置true,不允许重新计算grid 宽度 shrinkToFit =true ,这下就用这个jqgrid 的setGridWidth 也不能改变宽度

 formoptions:arry  这个选项是有效的只有在表单编辑      formoptions:{elmprefix:'(*)', rowpos:1, colpos:2....},

 formatter:mixed  格式化这个列  可选值;integer,number,currency,date,email,link,showlink ,checkbox,select ,actions, 示例;

  formatoptions:{decimalSeparator:",", thousandsSeparator: ",", decimalPlaces: 2, prefix: "$ "} 

  formatter:'showlink', formatoptions:{baseLinkUrl:'someurl.php', addParam: '&action=edit'}

  ==》http://localhost/someurl.php?id=123&action=edit

 frozen:boolean  默认false  是否冻结此列 ,如果这个设置true 将调用setFrozenColumns 方法

 hidedlg:boolean 默认false 如果设置true 将不会出现模式对话框供用户选择是否显示该列

 hidden:boolean 默认false 初始化是否显示该列

 index:string  索引名称排序 通过sidx参数传递

 jsonmap:string  定义了json映射的列在传入的json字符串

 key: boolean  默认false  如果服务端没有获取id ,这个值可以看成这个row的id ,如果出现多次将都是第一次设置的

 label: string  当colNames数组为空,定义了标题为这个label。如果两colNames数组和这个设置是空的,标题为这个label来自名称属性。

 name:string  必要的属性,具有唯一标识性,如在弹出的editform窗体中,将作为input的name属性

 resizable:boolean  默认值true  是否能改变大小

 search:boolean 默认值true 是查询模式是,是否禁用此列

 searchoptions: arry  自定义查询属性

 sortable: boolean 默认值true  是否能允许排序

 sorttype:mixed  默认值text  如果是本地数据需要排序类型  可选;text ,date ,integer ,float ,function

 stype:string 默认值text  搜索是确定元素的类型

 surl:string  只有在搜索 和编辑 选择是,能获取操作的url

 template: object  如果你想覆盖大量的默认值的列模型

 title:boolean 默认值false  如果这个选项错误,鼠标滑过是给出提示

 width:number 默认值150 设置列宽

 xmlmap:string 映射xml中的节点和当前列

 unformat:function  用了回复格式化数据

 viewable:boolean 默认true   只有当viewGridRow方法是激活这个选项才有用,当这个选项被设置为false列不显示在View From 中

 

 

 

posted @ 2013-01-23 23:56  sulin  阅读(1531)  评论(0)    收藏  举报