我已经建立了一个网格作为代码:
colModel: [
{ name: 'price',
label: 'price',
index: 'price',
jsonmap: 'price',
formatter: 'number',
formatoptions: {decimalSeparator:",", thousandsSeparator: ".", decimalPlaces: 2, defaultValue: '0,00'},
editable: true
}
]
字段的格式在网格上是正确的,例如:10,32,但是为编辑字段而创建的表单用10.32而不是10,32填充一个。
有人知道为什么会这样吗?我是否需要使用属性作为edittype和editoptions(这个使用formmater和formatoptions)?如果是,我需要如何设置这些属性?
答案 0 :(得分:0)
我已使用函数afterShowForm
修复了问题,以处理从网格生成的表单上字段的格式化。
事实上,我希望jQGrid
可以自动执行此操作,即使用提供给列的配置应用于生成的字段,或者如果我可以在JSON
消息上应用配置,实例:
editoptons: { formatter = "number", formatteroptions = { .... } ...
无论如何,它现在正在运作。