Picklist : sort after moving an item

UI Components for Angular
Post Reply
Delph
Posts: 5
Joined: 13 Sep 2017, 15:16

18 Oct 2017, 15:38

Hello,

I want sort the target and the source list after moving an item.
How can I do ?

Is there a post-moving function?

thanks.
Delphine

User avatar
sudheer
PrimeFaces Core Developer
Posts: 4345
Joined: 16 Oct 2011, 19:19
Location: Singapore

18 Oct 2017, 16:15

You can sort the list through callback events available.
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

Delph
Posts: 5
Joined: 13 Sep 2017, 15:16

19 Oct 2017, 10:36

Yes but this function is called before that the item is moving.

I utilise the "onMoveToSource" function. In this function, I do :
" this.sourceList.sort();"
When I move an item on the target list to the source list, this function is called before the item is moving.
And so, my list is not sorted.

User avatar
sudheer
PrimeFaces Core Developer
Posts: 4345
Joined: 16 Oct 2011, 19:19
Location: Singapore

19 Oct 2017, 12:21

You are right. We need callbacks after items moved. But you need to have 4 additional callbacks. You can raise a github request.
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 14 guests