johnny / johnny/jquery-sortable

.sortable('toArray', {attribute: 'data-id')) returns a list of jQuery objects

Open
#283 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
1.5k
Forks
429
PR merge metrics
No merged PRs in 30d

Description

Fiddle:
[https://jsfiddle.net/bturner1273/frgnw4cj](https://jsfiddle.net/bturner1273/frgnw4cj)

In my code I end up have to do:
` console.log(group.sortable('serialize').get(0).filter(i => i['id'] !== undefined).map(i => i.id));`

instead of:
` console.log(group.sortable('toArray', {attribute: 'data-id'}));`

output of group.sortable('toArray', {attribute: 'data-id'}):
![image](https://user-images.githubusercontent.com/32464706/94054649-e9adc000-fda9-11ea-9855-e91a95b67ca1.png)

expected result is an array of strings or numbers i.e.
[0,1,2,3,4] or ['0', '1', '2', '3', '4']

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.