【问题标题】:Keeping the currency formatted JQgrid cell blank without default value if no is value returned如果没有返回值,则将货币格式的 JQgrid 单元格保持为空白而没有默认值
【发布时间】:2014-09-05 21:18:19
【问题描述】:

我的 jqgrid 中的一个单元格是货币格式的 formatoptions:{decimalSeparator:".",千位分隔符:",",decimalPlaces:2,前缀:"$",defaultValue:''}

当我有它的价值时就是这种情况 但是在我没有对该特定字段的值的情况下,默认情况下网格需要 $0.00 我想保持空白而不是填充默认值,即 $0.00

我该怎么做? 在查找了一些问题后,我使用了自定义格式化程序

if (cellValue != 0.00) 


  {

    return $.fmatter.util.NumberFormat(closingAmount, $.jgrid.formatter.currency);

}
else
{

    return "";
}

在这种情况下,如何添加 $ 作为前缀?当然,在这个领域排序是行不通的。 期待某人的快速帮助和修复 提前谢谢!!

【问题讨论】:

    标签: javascript jquery jqgrid currency jqgrid-formatter


    【解决方案1】:

    您可以在自定义格式化程序中使用$.fn.fmatter.call(this, "currency", cellValue, options),而不是使用$.fmatter.util.NumberFormat

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-12-12
    • 2018-03-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-29
    • 2017-06-11
    • 1970-01-01
    相关资源
    最近更新 更多