jQWidgets Forums

jQuery UI Widgets Forums Grid Cell alignment with autoheight

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

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Cell alignment with autoheight #111604

    jlarue
    Participant

    When using autoheight, i’d like to be able to tell the grid to globally top-align content in all cells. I think i could accomplish this with a custom cell renderer for every cell, but in my case i have a lot of them, and it’d be nice to just set the preference once.

    One thing I run in to is that with autoheight, if i want to do a custom cell renderer for one column (create a hyper link for example) the middle alignment that exists by default is not used, and trying to realign that one column is difficult. I would rather just make the whole grid top-aligned.

    Is there a way to do something like this? If not, I’d just like to offer it as feedback 🙂

    thanks!

    Cell alignment with autoheight #111626

    Hristo
    Participant

    Hello jlarue,

    I am not absolutely sure that I understand you.
    The columns property has the cellsalign and the align members with which you could set how to be aligned the content horizontally.
    On the other hand, as you mentioned the cellsrenderer callback you could use it to completely customize the content of the cells.
    Its second argument provides information about the currently used column of the jqxGrid.
    You could use this information to specify how to be rendered depending on the case if you use the same function for all columns.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

    Cell alignment with autoheight #111635

    jlarue
    Participant

    Hi Hristo
    I’m looking for vertical alignment. This comes in to play when the row heights in the grid are of varying size based on the content (with autoheight:true). By default, content is vertically centered in every column. I’m looking to move the content to the top of every cell without using cellsrenderer for every column (if possible!)

    Cell alignment with autoheight #111652

    Hristo
    Participant

    Hello jlarue,

    If you only want to change the style of the cells then it will be better to use its class – jqx-grid-cell.
    Please, try this approach:

    .jqx-grid-cell div {
      margin-top: 0 !important;
    }

    More details about the available classes for the jqxGrid you could find on this page.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

    Cell alignment with autoheight #111653

    jlarue
    Participant

    Thanks Hristo – overriding the styles was the way to go!

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

You must be logged in to reply to this topic.