johnny / johnny/jquery-sortable

Serialize "onChange" list

Open
#188 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

Thanks for a handy plugin.

Not exactly an issue, but all I'm trying to achieve is get the stringified/serialized data from the list.

**Background of scenario:** I implemented an add/edit forms and delete which can manipulate the items in list(s). Now, as long as I drag/drop at least one item to a different position/list, I can get the serialized object and put it in a hidden input to send to server on submit. However, there can be cases where the user will just edit an item to change it's attribute(example: display text) saved to `data-*` of the item or can add/delete an item(`

  • `). This means, there hasn't been a call to `onDrag` which normally serialized my data so far.

    I know that I can use jQuery `.each()` or `.map()` to get the data and then serialize/stringify it. I'm just looking for a more straight forward way with this plugin.

    I have created a fiddle here: http://jsfiddle.net/gr2hfdna/
    I want the text area to get the JSON when an item is edited or a new item is added or an existing item is deleted.

  • 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.