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.

 

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值