nestedSortable
nestedSortable copied to clipboard
How can I set more variables in the array?
I looked at this question: http://stackoverflow.com/questions/5240114/need-help-getting-the-output-from-nestedsortable-jquery
When I do a var_dump on the data recived it displays the following:
array (size=1) 'list' => array (size=7) 0 => array (size=5) 'item_id' => string '' (length=0) 'parent_id' => string '' (length=0) 'depth' => string '0' (length=1) 'left' => string '1' (length=1) 'right' => string '14' (length=2) 1 => array (size=5) 'item_id' => string '2' (length=1) 'parent_id' => string '' (length=0) 'depth' => string '1' (length=1) 'left' => string '2' (length=1) 'right' => string '9' (length=1) 2 => ... No problem there everything works fine, but I want to send another variable, which in my case is the table to which the parent or child or grandchild belong to...I've modified the nestedSortable.js and adding in toArray: function(options) {
if (!o.excludeRoot) { ret.push({ "item_id": o.rootID, "parent_id": null, "table": null, "depth": sDepth, "left": left, "right": ($(o.items, this.element).length + 1) * 2 }); left++ } AND
if (id) { ret.push({"item_id": id[2], "parent_id": pid, "table": null, "depth": depth, "left": left, "right": right}); } But I don't know how to set, capture and send the value for the table, if anybody knows how I can send aditional info in the array I would really appreciate it...Thanks!!