您的位置:首页 > 其它

jqgrid格式化字符串(整型、数字、货币、日期、显示连接)

2010-08-28 11:39 405 查看
jqgrid的说明文档

Formatter Options

格式化选项对特定的列定义,覆盖缺省值。这是通过使用colMode的formatoptions阵列

示例:

colModel : [

...

{name:"myname"... formatter:'currency', formatoptions:{decimalSeparator:",", thousandsSeparator: " ",

decimalPlaces: 2, prefix: "$ "}},

...

]

formatter类型为:货币 。

小数分隔符为, 千位分隔符为 空格 小数位数为 2 前缀为$

类型

Options
integer
{thousandsSeparator: " ",
defaulValue: 0}
number
{decimalSeparator:".",
thousandsSeparator: " ", decimalPlaces: 2, defaulValue: 0}
currency
{decimalSeparator:".",
thousandsSeparator: " ", decimalPlaces: 2, prefix: "", suffix:"",
defaulValue: 0}
date
{srcformat: 'Y-m-d',newformat: 'd/m/Y'}
showlink
{baseLinkUrl: '',showAction: 'show'}
日期:formatter:'date',sorttype:'date',editrules:{date:true},search:false,editable:false,formatoptions: {srcformat:'Y-m-d H:i:s',newformat:'Y-m-d H:i:s'},datefmt:'Y-m-d H:i:s'
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: