jqGrid细节备注—colModel中可以设置Formatter

简介:

colModel中可以设置Formatter

jqGrid预定义了很多格式,每个不同的格式有不同的参数设置,可以在formatoptions中设置。

例如

< script> jQuery("#grid_id").jqGrid({ ... colModel: [ {name:'myname', formatter:'showlink', formatoptions:{baseLinkUrl:'someurl.php', addParam: '&action=edit'}, ...} ... ] ... })</script >


Type

Options

Description

integer

thousandsSeparator, 
defaulValue

thousandsSeparator determines the separator for the thousands, defaultValue set the default value if nothing in the data

number

decimalSeparator, 
thousandsSeparator, 
decimalPlaces, 
defaulValue

thousandsSeparator determines the separator for the thousands, decimalSeparator determines the separator for the decimals, decimalPlaces determine how many decimal places we should have for the number, defaultValue set the default value if nothing in the data

currency

decimalSeparator, 
thousandsSeparator, 
decimalPlaces, 
defaulValue, 
prefix, 
suffix

The same as number, but we add aditional two options - prefix: text that is inserted before the number and suffix: text that is added after the number

date

srcformat, 
newformat

srcformat is the source format - i.e. the format of the date that should be converted, newformat is the new output format. The definition of the date format uses the PHPconversions. Also you can use a set of predefined date format - see the mask options in the default date formatting set

email

none

When a mail type is used we directly add a href with mailto: before the e-mail

link

target

The default value of the target options is null. When this options is set, we construct a link with the target property set and the cell value put in the href tag.

showlink

baseLinkUrl, 
showAction, 
addParam,
target, 
idName

baseLinkUrl is the link. 
showAction is an additional value which is added after the baseLinkUrl. 
addParam is an additional parameter that can be added after the idName property. 
target, if set, is added as an additional attribute. 
idName is the first parameter that is added after the showAction. By default, this is id,

checkbox

disabled

The default value for the disabled is true. This option determines if the checkbox can be changed. If set to false, the values in checkbox can be changed

select

none

this is not a real select but a special case. See note below

actions


keys: false,
editbutton : true, 
delbutton : true, 
editformbutton: false, 
onEdit : null, 
onSuccess: null, 
afterSave:null, 
onError: null, 
afterRestore: null, 
extraparam: {oper:'edit'}, 
url: null, 
delOptions: {}, 
editOptions : {} 

This type of formatter is a easy way to add a buttons at certain column for inline editing. We add a two types of actions edit and delete. When the editformbutton parameter is set to true the form editing dialogue appear instead of in-line edit.

 

##########################################################################################















本文转自cnn23711151CTO博客,原文链接: http://blog.51cto.com/cnn237111/782123,如需转载请自行联系原作者








相关文章
echarts修改tooltip默认样式(使用formatter函数拼接加工)
echarts修改tooltip默认样式(使用formatter函数拼接加工)
271 0
|
9月前
Echarts组件tooltip提示框formatter函数返回的HTML样式解决方案
Echarts组件tooltip提示框formatter函数返回的HTML样式解决方案
265 0
|
5月前
|
JSON 数据格式
easyUI 的combobox如何获取除valueField和textField外的三个值
easyUI 的combobox如何获取除valueField和textField外的三个值
|
9月前
Echarts实战案例代码(40):tooltip使用formatter函数判断是否显示提示内容
Echarts实战案例代码(40):tooltip使用formatter函数判断是否显示提示内容
64 0
WPF项目中不支持 ResizingPanel,未在类型“ResizingPanel”中找到可附加的属性“ResizeWidth”
WPF项目中不支持 ResizingPanel,未在类型“ResizingPanel”中找到可附加的属性“ResizeWidth”
ts重点学习38-可选属性和只读属性笔记
ts重点学习38-可选属性和只读属性笔记
117 0
SAP UI5 formatter的原理和调试截图-当UI字段没有值显示时怎么办
SAP UI5 formatter的原理和调试截图-当UI字段没有值显示时怎么办
105 0
SAP UI5 formatter的原理和调试截图-当UI字段没有值显示时怎么办
|
XML 编解码 数据安全/隐私保护
HarmonyOS实战—Text组件宽高三种值的写法和颜色属性
HarmonyOS实战—Text组件宽高三种值的写法和颜色属性
548 0
HarmonyOS实战—Text组件宽高三种值的写法和颜色属性
|
前端开发 容器
Bootstrap学习笔记--图片,jumbotron,page-header,well,警告,按钮,Glyphicon组件,徽章,标签
图片: 图片属性加上这些就有不同效果 class=”img-rounded” class=”img-circle” class=”img-thumbnail” 注意 如果是circle圆的...
1588 0
|
JavaScript 前端开发 数据格式