Forums

Home » Alloy UI » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
Dan Liliedahl
TreeViewDD "insert (after)" exception
February 14, 2012 5:16 AM
Answer

Dan Liliedahl

Rank: New Member

Posts: 6

Join Date: May 17, 2010

Recent Posts

I am using the TreeView with drag/drop (TreeViewDD) and all works as expected until I try to do an insertAfter. At this point I get an exception. As a side note, "appendChild" wokrs fine!!!! My configuration is VERY simple:

SE.dashboard_library_tree = new A.TreeViewDD({
width: 175,
type: 'file',
boundingBox: '#dashboard-library-content',
children: list,
on: {
move: function(event) {
},
drop: function(event) {
},
lastSelectedChange: function(event) {
SE.dashboard_library_selected_node = event.newVal;
}
}
})
.render();

The exception occurs in custom-event.js at the line marked below:

/**
* Wrapper for a displaced method with aop enabled
* @class Do.Method
* @constructor
* @param obj The object to operate on
* @param sFn The name of the method to displace
*/
DO.Method = function(obj, sFn) {
this.obj = obj;
this.methodName = sFn;
this.method = obj; <<===== This is the line that gets the error (shown below)
this.before = {};
this.after = {};
};

The insert that I am trying to do is:
SE.dashboard_library_selected_node.insertAfter(newNode);
where SE.dashboard_library_selected_node is a valid node in the tree and newNode is a newly created node;

The error that I get is:
sFn is undefined
[Break On This Error] this.method = obj;

Upon examination both obj and sFn are undefined.

Is there any hope here in getting this to work? Any and all suggestions are appreciated.