alfajango / jquery-dynatable

A more-fun, semantic, alternative to datatables
http://www.dynatable.com
Other
2.77k stars 361 forks source link

Problem when using multi-dimensional url parameters #234

Open adam-clarey opened 8 years ago

adam-clarey commented 8 years ago

A simple problem to replicate, load a page with a dynatable on it and put the following as paramters in the url.

?field[0][this]=this&field[0][that]=that&field[0][other]=other

When the page is loaded, dynatable actually alters the url to become ?field[0][other]=other

It's because of a bug on line 1493:

hash[k] = $.extend({}, hash[k], v);

Because the object is nested you need to tell the $.extend function to recurse. So changing the above to:

hash[k] = $.extend(true, hash[k], v);

Fixes the problem.