FlexGrid: When to call autoresizerows in React

Posted by: simon.huang on 10 April 2019, 7:15 pm EST

    • Post Options:
    • Link

    Posted 10 April 2019, 7:15 pm EST

    I have some grid to list data in my React application, and I want these pages to follow “Responsive web design”, so I set column width with “*”.

    When these pages have loaded data, the cell with long text displayed correct by wraped.

    But when the column was resized down with browser resized, some text would be unvisible.

    Is there some events to call autoresizerows?

  • Posted 11 April 2019, 6:02 pm EST

    You could call the autoSizeRows() method in the columnResized event. Please refer to the sample below:

    https://codesandbox.io/s/71l4o62oz0

    Let us know if this is working for you.

  • Posted 11 April 2019, 7:58 pm EST

    Hello abhishek.dutta, thanks for reply.

    The sample worked good when resize column by column splitter.

    When user resize the browser and the column would be resized, but columnResized event is not raised, autoSizeRows() method would not be called.

  • Posted 14 April 2019, 10:26 pm EST

    Hello,

    You can handle the resize event of the window object to call autoSizeRows method whenever the browser is resized. Please refer to the sample demonstrating the same:

    https://codesandbox.io/s/m4lvmxjkn8

  • Posted 15 April 2019, 5:20 pm EST

    Thank you very much.

    This example is very usable for me.

Need extra support?

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

Learn More

Forum Channels