From 9d01ab564525f9112c2488ad257637593062b70d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Holger=20R=C3=BCprich?= Date: Mon, 5 Jul 2010 06:29:09 +0800 Subject: [PATCH] Sortable: Return an empty URL param for empty sortable lists. Fixed #5794 - sortable("serialize", {key: "foo[]"}) returns an empty string for an empty list --- ui/jquery.ui.sortable.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index a51f543c5..6cc2434e8 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -409,6 +409,10 @@ $.widget("ui.sortable", $.ui.mouse, { if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2])); }); + if(!str.length && o.key) { + str.push(o.key + '='); + } + return str.join('&'); }, -- 2.39.5