Open lybtt opened 4 years ago
I'm using ngx-sortablejs, and I ran into a problem when implementing multi-level sorting.
my data like this:
chapters: [{ title: 'chapter 01', child: [{ title: 'topic 1-1' }, { title: 'topic 1-2' }] }, { title: 'chapter 02', child: [{ title: 'topic 2-1' }, { title: 'topic 2-2' }] }]
<div *ngFor="let chapter of chapters" [sortablejs]="chapters" [sortablejsOptions]="itemListOptions"> <ul *ngFor="let topic of chapter.child" [sortablejs]="chapter.child" [sortablejsOptions]="itemListOptionsChild"> </ul> </div>
my question is: how can I get the chapter.child in itemListOptionsChild > onUpdate()? I need to get the currently selected array to sort.
(my English is not good, please forgive me)
I see the demo(https://stackblitz.com/edit/angular-ptu94s), should I use component to implement multi-level sorting?
I'm using ngx-sortablejs, and I ran into a problem when implementing multi-level sorting.
my data like this:
chapters: [{ title: 'chapter 01', child: [{ title: 'topic 1-1' }, { title: 'topic 1-2' }] }, { title: 'chapter 02', child: [{ title: 'topic 2-1' }, { title: 'topic 2-2' }] }]
my question is: how can I get the chapter.child in itemListOptionsChild > onUpdate()? I need to get the currently selected array to sort.
(my English is not good, please forgive me)