ng-matero / extensions

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

[Feature request] Add id field in MtxGridColumn #149

Closed sanioooook closed 1 year ago

sanioooook commented 1 year ago

Can you add id field in MtxGridColumn? Like id: (rowData, index) => string or simple id: string

nzbin commented 1 year ago

Can you tell me why you need an id field?

sanioooook commented 1 year ago

e2e tests in project are oriented to ids

nzbin commented 1 year ago

14.5.0 has added id field, please have a try.

sanioooook commented 1 year ago

it seems to me that I have not fully expressed my thought. can you also add the use of this id in the cells? Like [id]="col.id" for all <span> in cell.component.html

sanioooook commented 1 year ago

In tests, I need to get an element using a selector($('css-selector')), take the text from the element and compare it with what I expect

nzbin commented 1 year ago

it seems to me that I have not fully expressed my thought. can you also add the use of this id in the cells? Like [id]="col.id" for all <span> in cell.component.html

The id attribute is unique, it shouldn't be added to multiple elements.

nzbin commented 1 year ago

In tests, I need to get an element using a selector($('css-selector')), take the text from the element and compare it with what I expect

You can use custom column's class to get the element.

sanioooook commented 1 year ago

it seems to me that I have not fully expressed my thought. can you also add the use of this id in the cells? Like [id]="col.id" for all <span> in cell.component.html

The id attribute is unique, it shouldn't be added to multiple elements.

yes, I know, that's why I suggested id: (rowData, index) => string so that the id would be unique