Threaded View
-
4 Dec 2012 8:40 AM #1
Answered: Suppress 0 In Grid Column
Answered: Suppress 0 In Grid Column
I have a db file that contains a 3 digit number field (no decimals). If this field is "empty", naturally the value is 0. When I display this field in a grid, it shows up as 0. Instead of displaying 0, I want the field to display as blank. If the value is 3, it should show 3 (not 003). How do I suppress a value of zero (and any leading zeros) in a grid column? I tried searching for this answer but came up empty.
-
Best Answer Posted by Alexander Bauer
You can specify a custom renderer on a column, i.e.:
Code:{ // ... renderer : function(value) { value = parseInt(value); return value === 0 ? "" : value; } }


Reply With Quote