jQWidgets Forums

jQuery UI Widgets Forums Grid Number Formatting in Grid

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 10 years, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Number Formatting in Grid #59045

    tabiodun
    Participant

    I have a lot of grids in my application and I would like them to share the same number format in which negative numbers are in brackets and are coloured red. I would like to do this without registering cell renderer separately for every table.

    I tried tweaking the number format method in the library to allow me to do this globally, but I had to add some HTML to the returned string to get the red colour. This works, but whenever I pull and scroll the grid, the content of the cells change from HTML to plaintext and the html is escaped. Strangely this only happens on vertical scroll with the scroll bar, horizontal scroll and vertical scroll using a scroll wheel work just fine.

    Is there a better way to have negative numbers coloured red without having to register a cell format handler for every column of every grid? Alternatively, is the weird behaviour of the scrolling grid a known issue?

    Number Formatting in Grid #59049

    Peter Stoev
    Keymaster

    Hi tabiodun,

    You should use cellsrenderer if you want to format the rendering of a cell or row. The Grid’s defaultfunctionality demo demonstrates this.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.