Our blazing fast Grid component built with pure JavaScript


Post by rebkova »

Hi,

I can access width of a column element in a column renderer via renderData.cellElement.getBoundingClientRect().width. However, I only obtain the width of a column when the grid re-renders.

Is there a built-in way I could dynamically track the width of a column while dragging/resizing it?


Post by Animal »

The columns property of the grid will fire update events when a column has any of its fields mutated.

If your listener filters for when changes contains width, you can use that event:

Screenshot 2022-01-25 at 14.37.02.png
Screenshot 2022-01-25 at 14.37.02.png (48.89 KiB) Viewed 608 times

Post by rebkova »

The event couldn't be triggered neither on the columns' store nor column itself.

How did you trigger the event?


Post by Animal »

Like this:

grid.columns.on({
    update(e) {
        console.dir(e);
    }
});
columnsUpdate.gif
columnsUpdate.gif (3.21 MiB) Viewed 589 times

Post by rebkova »

That helped. Big thank you!


Post Reply