var $list = $(list);
var $parentID = $list.data('objectID');
- $list.children(this._options.items).each($.proxy(function(index, listItem) {
- var $objectID = $(listItem).data('objectID');
-
- if (!this._structure[$parentID]) {
- this._structure[$parentID] = [ ];
- }
-
- this._structure[$parentID].push($objectID);
- }, this));
+ if ($parentID !== undefined) {
+ $list.children(this._options.items).each($.proxy(function(index, listItem) {
+ var $objectID = $(listItem).data('objectID');
+
+ if (!this._structure[$parentID]) {
+ this._structure[$parentID] = [ ];
+ }
+
+ this._structure[$parentID].push($objectID);
+ }, this));
+ }
}, this));
// send request