attempt to implement focusItem, to be able to scroll to a selected Item automatically; implement wrapper for hasChildren from dhtmlXTree API

This commit is contained in:
Klaus Leithoff 2013-12-09 16:00:15 +00:00
parent a9903e8847
commit 4c03a02926

View File

@ -316,6 +316,7 @@ var et2_tree = et2_inputWidget.extend(
else
{
this.input.selectItem(this.value, false); // false = do not trigger onSelect
this.input.focusItem(this.value);
this.input.openItem(this.value);
}
},
@ -467,6 +468,28 @@ var et2_tree = et2_inputWidget.extend(
);
},
/**
* focus the item, and scrolls it into view
*
* @param _id ID of the node
* @return void
*/
focusItem: function(_id) {
if(this.input == null) return null;
this.input.focusItem(_id);
},
/**
* hasChildren
*
* @param _id ID of the node
* @return the number of childelements
*/
hasChildren: function(_id) {
if(this.input == null) return null;
return this.input.hasChildren(_id);
},
/**
* Callback for after using dhtmlxtree's AJAX loading
* The tree has visually already been updated at this point, we just need