1. Kendo UI grid does not support min-width for the columns;
2. Developer can set min-width css on the whole grid element;
3. A js function can capture event when user resizes individual column manually and prevent user to go under given width.
In a most user friendly way the column configuration should have taken column width in % and min-width.
Are there any plans to implement this feature?
Is there a known function which can work as window.onresize and resize grid columns proportionally with given column min widths? Can min widths be added to columns configuration and then accessed by this function?
7 Answers, 1 is accepted
There is a columnResize event that the Kendo UI Grid fires every time the user tries to resize the width of the column. In this event you can determine what is the current width of the column and according to the preset width resize the column. Please check the following example and let me know if it helps:
The IE crash seems to result from the jQuery's attempts to obtain the width of each col element, but this happens on the second column resize, before the columnResize event had been fired. This is strange to say the least.
You can check this code library entry that uses a different implementation:
Generally, there is no single best approach, so choose the algorithm and user experience that suits you most (i.e. prevent the user from over-resizing during dragging, or restoring some predefined min/max column width after dragging).
Having said that I do think that support for a minimum width for grid columns would be nice. Or even a fixed size or maximum size.
Thanks for your feedback.
I will forward it to the people responsible for the implementation of the Kendo UI Grid, so they will consider it for a future release.
In case you have any further questions, please do not hesitate to contact us.
It seems like this is critical functionality that is missing.
I agree this is a nice-to-have feature, but rather tricky to implement so that it works well in terms of practicality, user experience and performance.
Have you tried setting a min-width style to the Grid table? This is an easy and script-less approach to achieve always-visible width-less columns, which usually does the job. I hope this technique will fit your use case.
The following page provides more information and sample code snippets:
On a side note, even if your scenario is complex and static min-width may not work well, you can consider applying variable min-width to the tables programmatically, instead of setting different widths to all columns.