NG-ZORRO / ng-zorro-antd

Angular UI Component Library based on Ant Design
https://ng.ant.design
MIT License
8.85k stars 3.9k forks source link

nz-table custom selection divider #8318

Open egalley opened 8 months ago

egalley commented 8 months ago

What problem does this feature solve?

Hello,

It would be great if we can add separator in the nzSelections maybe setting text to '-'.

Thank you

What does the proposed API look like?

listOfSelection = [ { text: 'Select All Row', onSelect: () => { this.onAllChecked(true); } }, { text: '-', onSelect: () => { } }, { text: 'Select Odd Row', onSelect: () => { this.listOfCurrentPageData.forEach((data, index) => this.updateCheckedSet(data.id, index % 2 !== 0)); this.refreshCheckedStatus(); } }, { text: 'Select Even Row', onSelect: () => { this.listOfCurrentPageData.forEach((data, index) => this.updateCheckedSet(data.id, index % 2 === 0)); this.refreshCheckedStatus(); } } ];

ParsaArvanehPA commented 7 months ago

Hi @egalley I didn't fully understand what you meant; could you explain it a bit more?

And just a quick note, if you are asking for a change in the Table component, that change must also be available in the Ant designs' Table component, because we are the Angular equivalent of Ant and we can't add something that is not in the original design.

egalley commented 7 months ago

Hello Parsa,

Certainly here's a reproduction link, see comment on line 51.

https://stackblitz.com/edit/angular-irzpae-8qo8mp?file=src%2Fapp%2Fapp.component.ts

In the NzSelections of TableComponent, I would like to put a line separator.

Thank you to see if some improvement is possible.