ng-matero / extensions

Angular Material Extensions Library.
https://ng-matero.github.io/extensions/
MIT License
388 stars 48 forks source link

mtx-grid avoid specific column to be "hideable" #264

Closed SYS64738 closed 4 months ago

SYS64738 commented 5 months ago

Hi, I'm using [columnHideable] with corresponding menu to hide/show the columns.

Typically I use the first column in table as "action" column (with buttons, expandable, etc...), so I woulnd't permit to hide this column.

There's a way to avoid that a column (some columns) could be hide ? a kind of "lock" of visibility column (as like as "sortable", "resizable", etc...).

Thank you very much! Roberto

nzbin commented 5 months ago
columns: MtxGridColumn[] = [
  {
     ....
     disabled: true,
  }
]
SYS64738 commented 5 months ago

Thanks! It works fine about hiding/showing column.

It would be great if there's a way to avoid moving column too (I suppose disabled flag could be use for both behavior): in fact an "action" column with button, expandable arrow, etc... should be in a fixed position (at start or end of a row); I already set "pinned = 'left'" but the column could be moved and "overtake" by other columns.

I think the best solution should be: if a column has pin left or right and has disabled flag = true, no other “floating” columns could overtake it and that column couldn’t be moved.

Good: image

Not so good ;-) image

Thank you!!!

nzbin commented 4 months ago

I think the best solution should be: if a column has pin left or right and has disabled flag = true, no other “floating” columns could overtake it and that column couldn’t be moved.

It's very hard to implement, I hope someone can provide a PR.

hanogin commented 2 months ago

@nzbin I have a few column that i do not want to be hide nor moved, i want them show and in the initial order all the time. How about if a column has a diable flag (or some other name flag) then in that case we do not not showing it at all on the menu, is it hard to implement as well?