igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

Narrower column width than 88px

Open ymita opened this issue 7 years ago • 5 comments

Current limitation of 88px as the minimum width is too wide. There are situations that I only want to allocate column width just enough to render a single character.

This feature is helpful when I have a column which renders an abbreviation of a word. For example, the column represents score of record item. In the screenshot, ‘高’ means ‘High’, ‘中’ means ‘Middle’, and ‘低’ means ‘Low’. I don't want to consume 88px width only for a single character. Rendering abbreviated word to save width on grid is a common use case in Japanese.

image http://jsfiddle.net/rohs312n/

ymita avatar Apr 22 '19 05:04 ymita

@ymita is this issue for igniteui repository? If you are using igGrid as a reference to showcase the behavior that you desire in the igxGrid, let me know and I will transfer it back to igniteui-angular repo.

zdrawku avatar Apr 22 '19 07:04 zdrawku

@zdrawku Oh my bad. It is for igxGrid :)

ymita avatar Apr 22 '19 07:04 ymita

@ymita The min column width of 88px is driven by the minimum size of the header, which should accommodate for the header text + paddings + sorting indicator for sortable columns + column operations UI element for filtering/moving/etc + resizing handler.

What we can do is not account for the elements for sorting + filtering + resizing, when [sortable]="false", [filterable]="false" and [resizable]="false". This can reduce the minimum column width, if and only if, none of the features requiring header UI elements is enabled for the particular column.

kdinev avatar Apr 22 '19 10:04 kdinev

@kdinev What if a column enables such features? If the column is resized to smaller width, does it simply hide/truncate feature icons?

I experimentally set the default value of _defaultMinWidth to ‘0’ in column.component.ts. Feature icons are hidden or partially hidden but they seem to be working fine. You can watch the video. On the left most column, I enabled sorting, filtering, column moving, pinning and summaries. I tweaked on grid summary cell style though, there is any other change made.

video 20190425_134105.zip

ymita avatar Apr 25 '19 04:04 ymita

Hello @ymita, this feature is part of the new versions released yesterday (8.0.2 and 7.3.7), now you can set smaller minWidth of the column than the default one, and resize it with UI interaction accordingly. Let me know if you have any comments :)

zdrawku avatar Jun 26 '19 12:06 zdrawku