default searchAttr to valueField (assumes a markup-based implementation ...); add...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 14 Jan 2009 17:21:40 +0000 (17:21 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 14 Jan 2009 17:21:40 +0000 (17:21 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@11826 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/widget/FilteringTreeSelect.js

index 76c8645..f71dc43 100644 (file)
@@ -35,7 +35,8 @@ if(!dojo._hasResource["openils.widget.FilteringTreeSelect"]){
                 if (!dojo.isArray(this._tree)) this._tree = [ this._tree ];
 
                 this._datalist = [];
-                if (!this.valueField) this.valueField = this._tree.Identifier;
+                if (!this.valueField) this.valueField = this._tree[0].Identifier;
+                if (!this.searchAttr) this.searchAttr = this.valueField;
 
                 var self = this;
                 this._tree.forEach( function (node) { self._add_items( node, 0 ); } );
@@ -43,6 +44,7 @@ if(!dojo._hasResource["openils.widget.FilteringTreeSelect"]){
                 this.store = new dojo.data.ItemFileReadStore({
                     data : {
                         identifier : this.valueField,
+                        label : this.labelAttr,
                         items : this._datalist
                     }
                 });