jQWidgets Forums

jQuery UI Widgets Forums Grid padding in cells when rowsheight is changed

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • padding in cells when rowsheight is changed #11128

    DaveC426913
    Member

    The default rowsheight is 25. That’s too tall for me, so I changed it to 20.

    So the rows are narrower, great, but the text is not vertically centered in the row anymore. It’s a couple of pixels too low. I would have thought that, if the widget were going to programmatically handle its row height, that it would also handle the centering of the text in its rows.

    I could add some CSS, but the actual element that has its margin set is not classed at all; it is a bare div. The cells look like this:

    <div class="jqx-grid-cell jqx-grid-cell-curo-widgets" style="overflow: hidden; position: absolute; height: 100%; left: 0px; z-index: 779; width: 128.45px; margin-left: 0px;">
    <div style="overflow: hidden; text-overflow: ellipsis; padding-bottom: 2px; text-align: left; margin: 4px;">5033DF88C3E35</div>
    </div>

    (I lie. It actually does programmatically set the cell content margins; you can see it there in line 2: margin: 4px;. That’s done programmatically. It’s just that it doesn’t set it properly when you change rowheight and I don’t have access to that property.)

    This works, but it’s ugly (if you’re using !important like this, you’re probably doing something wrong):

    .jqx-grid-cell-curo-widgets > div{
    margin: 1px 4px !important;
    }
    padding in cells when rowsheight is changed #11130

    Peter Stoev
    Keymaster

    Hi Dave,

    If you want to modify the built in rendering of the cells, implement the cellsrenderer callback function.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    padding in cells when rowsheight is changed #11132

    DaveC426913
    Member

    Well, I guess, but it seems to me then that the rowsheight property is sort of wanting if it can’t be used without having to invoke the cellsrenderer.

    I can’t think of any realistic scenario where someone would want to modify the rowheight without wanting the content within the row to have uniform margins (unless they wanted tall fixed-height rows with all their content aligned to top).

    Thanks.

    padding in cells when rowsheight is changed #11134

    Peter Stoev
    Keymaster

    Hi Dave,

    Having many properties and customization options always have pros and cons. We will do our best to improve the behavior in the future.

    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.