Skip to content

Commit

Permalink
Set pagesize when filtering in column
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanlanciaux committed Mar 14, 2016
1 parent 553d049 commit 75c252d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions examples/customization/customColumn.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@
});

var HeaderComponent = React.createClass({
textOnClick: function(e) {
e.stopPropagation();
},

filterText: function(e) {
this.props.filterByColumn(e.target.value, this.props.columnName)
},

render: function(){
return (
<span>
<strong style={{color: this.props.color}}>{this.props.displayName}</strong>
<input type='text' onChange={this.filterText} />
<div><strong style={{color: this.props.color}}>{this.props.displayName}</strong></div>
<input type='text' onChange={this.filterText} onClick={this.textOnClick} />
</span>
);
}
Expand Down
3 changes: 2 additions & 1 deletion scripts/griddle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,9 @@ var Griddle = React.createClass({
columnFilters: columnFilters
};

if(filteredResults.length > 0) {
if(columnFilters) {
newState.filteredResults = filteredResults;
newState.maxPage = this.getMaxPage(newState.filteredResults);
} else if(this.state.filter) {
newState.filteredResults = this.props.useCustomFilterer ?
this.props.customFilterer(this.props.results, filter) :
Expand Down

0 comments on commit 75c252d

Please sign in to comment.