Results 1 to 4 of 4

Thread: Suppress 0 In Grid Column

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    May 2010
    Dallas, TX
    Vote Rating

    Default 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.

  2. You can specify a custom renderer on a column, i.e.:

    // ...
    renderer : function(value) {
    value = parseInt(value);
     return value === 0 ? "" : value;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts