jQWidgets Forums

jQuery UI Widgets Forums Grid Leading Zero not displayed

Tagged: 

This topic contains 3 replies, has 3 voices, and was last updated by  Peter Stoev 9 years, 11 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Leading Zero not displayed #13828

    soonkoh
    Member

    I have a grid with a column with customer PO No., some customers have PO No. starts with ‘0’ (zero), for example: 0014, in the grid, it is displayed as ’14’. For your information, I have set the type to string: { name: ‘customer_po_no’, type: ‘string’ }

    So I added a single quote in front, but when I want to filter this particular PO No. out, I put in 0014, no result, I put in ‘0014, no result displayed as well. Please advise, thanks.

    Leading Zero not displayed #13835

    Peter Stoev
    Keymaster

    Hi soonkoh,

    Parsing of a Number will remove leading zeros. However, for Filtering and Sorting of Numeric columns you will need to set your field’s type to “number”. The solution for your scenario would be to override the built-in rendering and use a custom cell rendering for your column. You can learn how to do that in this help topic: jquery-grid-cellsrendering.htm.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Leading Zero not displayed #73170

    ziggy
    Participant

    I encountered the same error. I have a grid with employee number column that is hidden. When I tried getting the value of the hidden column (ex. ‘00797’), I get ‘797’. I have set the type to string too. Will the cell renderer fix the issue for hidden columns too?

    Please advise, thanks!

    Regards

    Leading Zero not displayed #73213

    Peter Stoev
    Keymaster

    Hi Karen,

    If the data type is String, you will get a String as loaded from the data source. It it’s not, you will get a formatted number. It does not matter whether it starts with 0 or with ” ” in case it’s a string.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.