gainkda.blogg.se

Autosize js
Autosize js




So you might need to change the way the last visible column in the UI is retrieved to make it work for your case. I am expecting the last column inside the columns array to be the last visible one in the UI, but that might not always be the case and you might end up with wrong calculation of the space that is left to fill.

autosize js

Keep in mind that this implementation plays out well in my case as columns are not movable. You can plug the handleResize function on row-data-updated event to resize columns whenever new data arrives in the grid or only once in grid-ready or first-data-rendered. That should be fairly easy to transfer to other frameworks (or vanilla js). This was a fun project I started in Aug 2012 as a jQuery plugin. No jQuery dependency either, just plain vanilla JS. Then apply the new column state through gridApi.appl圜olumnState. This package contains a TextareaAutoSize ES6 class for vertically adjusting a textarea based on user input and controlling any presentation in CSS.No clone or ghost elements are used.

autosize js

What I did is onGridReady, I would use the autoSizeColumns function to make sure that each column's content is fully visible, and then if there is an additional space left to fill the grid's width I distribute it evenly to each column. Unfortunately there doesn't seem to be a really straightforward way to achieve that.

autosize js

If I understand you correctly you want to have the following behaviour for resizing - make sure each column has it's content visible first, but then also make sure that the whole grid width is filled at the least.






Autosize js