Autosize column header not working

Posted by: heysaad on 14 September 2017, 11:15 am EST

    • Post Options:
    • Link

    Posted 14 September 2017, 11:15 am EST

    Autosize column header not working when columns are binding dynamically.

    I add auto-size-mode=“Headers” to

    [html]

    <wj-flex-grid items-source=“ctx.data” auto-size-mode=“Headers”

    auto-generate-columns=“false”

    initialized=“initGrid(s,e)”

    [/html]
  • Posted 14 September 2017, 11:15 am EST

    Hello,

    AutoSizeMode defines the row/column behavior when auto-sizing is performed. Hence, you need to call autoSizeColumn()/autoSizeColumns() methods in the initialized event to see its effect.

    Here is the fiddle: http://jsfiddle.net/fsmgp0pq/2/

    Regards

  • Posted 14 September 2017, 11:15 am EST

    thanx,

    that worked for me. also i want to add extra padding to left and right of header after auto resize.

    how can i do that.

  • Posted 14 September 2017, 11:15 am EST

    Hello,

    You can use the following css to change the header element:

    [css] .wj-header {

    padding-left: 20px!important;

    padding-right: 20px!important;

    }[/css]

    Regards

  • Posted 14 September 2017, 11:15 am EST

    We are currently using the auto width/ autoSizeColumns feature provided by wijmo flexgrid in our application, it seems to be working when the column data text is larger than the header text. But not when the header text is larger than the column data text. When we use the autoSizeColumns feature for a case where the column header text is larger than the column data text, the column header text is getting trimmed of, seems like the column header text length is not taken into consideration for calculating column width.

    The same has been re-created in the below provided link, please click on the Auto Size button to check the autoSizeColumns feature.

    http://plnkr.co/edit/UP1ht3c1jpU3pcONAzng?p=preview

  • Posted 14 September 2017, 11:15 am EST

    @anup.george, thanks for posting.

  • Posted 14 September 2017, 11:15 am EST

    Hello Anup,

    The autoSizeColumns() resize column with size available. If you will increase the window size, you will not be able to reproduce the issue.

    Please see the attached video that depicts the same.(Try in IE)

    Thanks,

    Manish Kumar Gupta

    2017/06/autoSizeColumn.zip

  • Posted 14 September 2017, 11:15 am EST

    @Manish Gupta, Sorry for the delay. As you said the issue is not reproducible when I increase the window size, but it seems to exist when the flex grid is having a horizontal scroll bar. Our applications has more number of columns so on execution of autoSizeColumns() the grid will be having a horizontal scroll bar to show all the columns and the issue mentioned comes in.

  • Posted 14 September 2017, 11:15 am EST

    Hello Anup,

    We are sorry, we are unable to replicate the issue at our end even if the horizontal scrollbar is available in FlexGrid.

    Please refer to the attached sample used for replicating the issue.

    Thanks,

    Manish Kumar Gupta

    2017/06/FlexGrid_autoSizeColumn_header.zip

  • Posted 14 September 2017, 11:15 am EST

    Hi Manish,

    Just including the ‘wijmo.grid.filter.min.js’ to the example you have provided will bring in the issue. Could you please have a look.

    Thanks and Regards

    Anup George

    2017/06/FlexGrid_autoSizeColumn_header_updated.zip

  • Posted 14 September 2017, 11:15 am EST

    Hello Anup,

    Thanks for additional information.

    We are able to replicate the issue at our end and it looks like a bug. Hence, this issue has been escalated to the concerned team for further investigation with tracking id 269285.

    We will let you know as soon as we get any update on this issue.

    Thanks,

    Manish Kumar Gupta

  • Posted 14 September 2017, 11:15 am EST

    Thanks for the update Manish.

  • Posted 8 January 2018, 8:28 am EST

    Hi Anup,

    This issue has been found fixed in build 5.20173.380 (current official release).

    ~Manish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels