#5794 closed enhancement (fixed)
sortable("serialize", {key: "foo[]"}) returns an empty string for an empty list
Reported by: | Holger | Owned by: | |
---|---|---|---|
Priority: | trivial | Milestone: | 1.8.3 |
Component: | ui.sortable | Version: | 1.8.2 |
Keywords: | Cc: | Holger | |
Blocked by: | Blocking: |
Description
The serialize method returns an empty String for empty lists when a custome key is defined. A form/ajax submittable string should rather be 'foo[]=' in the following example, if option_1 is moved to the connected list #bar:
<ul id="foo" class="sortable"> <li id="option_1">1</li> </ul> <ul id="bar" class="sortable"> <li id="option_2">2</li> </ul> <script type="text/javascript"> $(function(){ $('.sortable').sortable({ connectWith: '.sortable', update: function (event, ui) { console.log('Update: ' + $(event.target).sortable('serialize', { key: event.target.id + '[]' }) ); } }); }); </script>
Change History (4)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
Milestone: | TBD → 1.9 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed in 9d01ab5.
comment:3 Changed 13 years ago by
Milestone: | 1.9 → 1.8.3 |
---|
comment:4 Changed 12 years ago by
Sortable: Return an empty URL param for empty sortable lists. Fixed #5794 - sortable("serialize", {key: "foo[]"}) returns an empty string for an empty list
Changeset: 9d01ab564525f9112c2488ad257637593062b70d
Note: See
TracTickets for help on using
tickets.
Patch on github: http://github.com/holger/jquery-ui/commit/f1a7824791565c46c036df66503c6bdd9f802b90