[open-ils-commits] r11783 - trunk/Open-ILS/web/js/dojo/openils/widget
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Jan 9 10:16:23 EST 2009
Author: erickson
Date: 2009-01-09 10:16:21 -0500 (Fri, 09 Jan 2009)
New Revision: 11783
Modified:
trunk/Open-ILS/web/js/dojo/openils/widget/FilteringTreeSelect.js
Log:
allow the caller to provide a reference to the tree. use toStoreItem instead of toStoreData
Modified: trunk/Open-ILS/web/js/dojo/openils/widget/FilteringTreeSelect.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/FilteringTreeSelect.js 2009-01-09 15:10:07 UTC (rev 11782)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/FilteringTreeSelect.js 2009-01-09 15:16:21 UTC (rev 11783)
@@ -30,7 +30,8 @@
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 @@
_add_items : function ( node, depth ) {
var lpad = this.defaultPad * depth++;
- var data = node.toStoreData();
+ var data = node.toStoreItem();
data._label = '<div style="padding-left:'+lpad+'px;">' + node[this.searchAttr]() + '</div>';
this._datalist.push( data );
More information about the open-ils-commits
mailing list