开发者

jQuery: is there a bug in how jQuery.ui.sortable ajax:update sends data?

开发者 https://www.devze.com 2023-01-13 16:53 出处:网络
code: http://jsfiddle.net/WRppV/4/ I should get something like \"content\"=> [\"141\", [\"203\", \"206\", \"204\", \"205\"],

code: http://jsfiddle.net/WRppV/4/

I should get something like

"content"=>
    ["141", ["203", "206", "204", "205"],
     "142", ["215", "207"]]

but i get

  Parameters: {"action"=>"sort_contents", "content"=>"20开发者_运维知识库7,215", "controller"=>"contents"}

Which are the last two values in the array.... I should be getting everything shouldn't I?


The problem is with the jQuery.param function which gets called to parse the data option with jQuery.ajax. Looks like from the jsFiddle that you are using jQuery 1.3.2. In 1.3.2 the jQuery.param function didn't handle deep objects like you are creating here. In 1.4 jQuery.param was updated to handle deep object.

Try upgrading to 1.4 and it should help.

0

精彩评论

暂无评论...
验证码 换一张
取 消