以下是我的代码,但我的网格显示为99999.00
{label: 'AmtLimit', name: 'amtLimit', width: 80, editable: true,
// template: numberTemplate,
formatter: 'number', align: 'right', sorttype: 'number',
editrules: {number: true, required: true},
formatoptions:{ decimalPlaces: 2 },
editoptions: { maxlength: 9}
答案 0 :(得分:1)
我认为你要向网格发送一个整数,它应该以double或float的形式发送到999.99
假设我告诉你两个陈述
我认为你会同意第二个更有意义,即使你不把它变成10.00然后仍然可以理解为10值是相同的。
在你的情况下,如果JQgrid无法格式化数据,它将具有非常不同的含义,这通常是错误的。数据获得为9999并依靠javascript成功将其转换为99.99。我建议您在服务器端使用适当的数据格式,或者发送数据以确保其格式为double或float格式。