jQuery MiniUI

标题: grid Drawcell 设置单元格style错误 [打印本页]

作者: jipinkuang    时间: 2014-1-9 17:17:37     标题: grid Drawcell 设置单元格style错误

本帖最后由 jipinkuang 于 2014-1-9 17:21 编辑
复制代码
grid.on("drawcell", function (e) {
        var record = e.record,
        column = e.column,
        field = e.field,
        value = e.value;

                if (field == "H_TBT" && value > record.B_TBT) {
                           alert (value +' > '+ record.B_TBT)
                       e.cellStyle = "color:red;"
                }

})

原意是想 如果实际大于预算时,用红色字体显示,
但是现在 小于的也是 红色, alert 出来的结果正常。
[attach]3682[/attach]
[attach]3680[/attach]

[attach]3681[/attach]





作者: felt    时间: 2014-1-9 17:27:58

加下parseInt()把值转化成int再比较
parseInt(value)
parseInt(record.B_TBT)





欢迎光临 jQuery MiniUI (http://miniui.com/discuss/) Powered by Discuz! X2