Skip to content

Commit

Permalink
facet searching now works
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuels committed May 3, 2012
1 parent 1856063 commit d3773b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions js/Model/TrackMetaData.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,17 @@ dojo.declare( 'JBrowse.Model.TrackMetaData', null,

var set = [];
dojo.forEach( queryValues, function(val) {
set.push( index.byValue[val] || [] );
},this);
var bucket = index.byValue[val];
if( bucket )
set.push.apply( set, bucket.items );
},this);
return set;
}).call(this);

// and filter this starting set for the other facets
dojo.forEach( dojof.keys(query), function(facetName) {
var desired_values = query[facetName] || [];
if( desired_values.length )
if( ! desired_values.length )
return;
results = dojo.filter(results, function(item) {
var value = this.getValue(item,facetName);
Expand Down
5 changes: 3 additions & 2 deletions js/View/TrackList/Faceted.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ dojo.declare( 'JBrowse.View.TrackList.Faceted', null,
this.gridContainer = dojo.create('div',{
className: 'gridContainer',
style: {
width: (2+facets.length * 100) + 'px',
height: '60%',
width: (12+facets.length * 100) + 'px',
height: '80%',
"float": 'left'
}
},this.container);
Expand Down Expand Up @@ -170,6 +170,7 @@ dojo.declare( 'JBrowse.View.TrackList.Faceted', null,

this.query = newQuery;
console.log(this.query);
this.dataGrid.setQuery( this.query );
},

/**
Expand Down

0 comments on commit d3773b9

Please sign in to comment.