From: erickson Date: Fri, 9 Jan 2009 15:16:21 +0000 (+0000) Subject: allow the caller to provide a reference to the tree. use toStoreItem instead of... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1b03e1ae38a859eb92a6a9ee6894577b823b74c3;p=Evergreen.git allow the caller to provide a reference to the tree. use toStoreItem instead of toStoreData git-svn-id: svn://svn.open-ils.org/ILS/trunk@11783 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/dojo/openils/widget/FilteringTreeSelect.js b/Open-ILS/web/js/dojo/openils/widget/FilteringTreeSelect.js index 6baf42e33a..76c86454f5 100644 --- a/Open-ILS/web/js/dojo/openils/widget/FilteringTreeSelect.js +++ b/Open-ILS/web/js/dojo/openils/widget/FilteringTreeSelect.js @@ -30,7 +30,8 @@ if(!dojo._hasResource["openils.widget.FilteringTreeSelect"]){ this.labelAttr = '_label'; // force it this.labelType = 'html'; // force it - this._tree = dojox.jsonPath.query(window, '$.' + this.tree, {evalType:"RESULT"}); + this._tree = (typeof this.tree == 'string') ? + dojox.jsonPath.query(window, '$.' + this.tree, {evalType:"RESULT"}) : this.tree; if (!dojo.isArray(this._tree)) this._tree = [ this._tree ]; this._datalist = []; @@ -52,7 +53,7 @@ if(!dojo._hasResource["openils.widget.FilteringTreeSelect"]){ _add_items : function ( node, depth ) { var lpad = this.defaultPad * depth++; - var data = node.toStoreData(); + var data = node.toStoreItem(); data._label = '
' + node[this.searchAttr]() + '
'; this._datalist.push( data );