Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I set more variables in the array? #119

Open
wants to merge 83 commits into
base: 2.0alpha
Choose a base branch
from

Conversation

antonioj1015
Copy link

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!!

Nytrm and others added 30 commits October 3, 2013 12:05
This update allows you to preset the expanded or collapsed class on
individual branches to give finer grain control over individual branch
status on start. This allows overriding the default startCollapsed
option on a per-branch level as needed.

I needed this so that I could ‘remember’ the state of individual
branches and restore them on page load.
styling, ui icons, expand/contract, and inner content
To be able to disable changing parentship but allow reordering in current parent.
I use it for menu ordering of pages, where pages define parentship and a menu defines the sort order
disableParentChange option added.
Explain new disableParentChange option.
load as AMD module if AMD is available
Github pages use https instead of http. So including js and css from Google CDN via http fails in modern browsers.

<script src="//code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script>
This snippet gets https://code.jquery.com/ui/1.10.4/jquery-ui.min.js on a https enabled site. On a http site  http://code.jquery.com/ui/1.10.4/jquery-ui.min.js is pulled.
Protocol neutral references
Matt Parnell and others added 30 commits March 7, 2015 22:32
This also make _clearEmpty() code a bit more readable
Keep branchClass on root item if protectRoot is true
Fixed disableParentChange always preventing sorting on root.
Fix helper positioning bug when window scrolled
Added Meteor.js Package support
Fixed scrolling offset problem.
Add ability to use data- attributes to show up in the hierarchy.
most database tables use id not item_id
add element name to array
Update version to 2.0b1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.