jQWidgets Forums

jQuery UI Widgets Forums Grid Default Column Width Overruns Table Based On Header Length

This topic contains 2 replies, has 2 voices, and was last updated by  Gary 4 years, 9 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • Gary
    Participant

    If I create a grid with multiple columns with minimum width settings that sum to less than the overall table width, the columns will all fit IF the header names are of approximately the same width.
    Example, all headers same size, no horizontal scrollbar.
    http://jsfiddle.net/GaryGen/6vj4ha7d/7

    However, if the header names are disproportionate in size, the column widths are rendered disproportionate. This is fine. However, if the minimum width is applied, it causes the width of the columns to overrun the width of the table despite the data actually being smaller.
    Example, all headers same size except shorter last, resulting in horizontal scrollbar.
    http://jsfiddle.net/GaryGen/6vj4ha7d/6

    Diagnosed this behavior looking at _rendercolumnheaders. The default column widths take the host width and size based on the proportion of the column header size to the length of all column headers. This is a repeatable, documentable approach, especially since only the column header size may be known at this point. However, if minwidth is larger than the allocated size, the column size is increased without taking the offset from the other columns. Therefore, even though the algorithm appears to initially intend to fit the columns in the allocated width, it does not adjust the algorithm for minWidth, resulting in table width overruns that do not need to occur.

    Would be really nice if whatever algorithm was used for default column size adjusted to better handle min/maxWidth. May require minor looping, but would result in MUCH better default sizing.


    admin
    Keymaster

    Hi Gary,

    Thanks for the detailed feedback and the examples.
    Our team created a work item about that: https://github.com/jqwidgets/jQWidgets/issues/315

    Best wishes,
    Peter Stoev

    jQWidgets Team
    https://www.jqwidgets.com/


    Gary
    Participant

    Thank you!

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

You must be logged in to reply to this topic.