ngx-sortablejs icon indicating copy to clipboard operation
ngx-sortablejs copied to clipboard

Hi, How to sort in multiple levels?

Open lybtt opened this issue 5 years ago • 1 comments

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)

lybtt avatar Jun 22 '20 09:06 lybtt

I see the demo(https://stackblitz.com/edit/angular-ptu94s), should I use component to implement multi-level sorting?

lybtt avatar Jun 23 '20 02:06 lybtt