|
public onComplete(args){
if(args.requestType == "searching"){
new DataManager(data)
.executeQuery(new Query().search(args.searchString, []))
.then((e: ReturnOption) => {
var rows = e.result; //here we can get the search results
console.log(rows);
});
}
}
...
render() {
return (<div>
<GridComponent id="Grid" dataSource={data} actionComplete={this.onComplete.bind(this)} toolbar={this.toolbarOptions} ref={g => this.gridInstance = g} height={240}>
<ColumnsDirective>
...
</ColumnsDirective>
<Inject services={[ Toolbar ]} />
</GridComponent></div>)
} |
|
public searchFunction (){
new DataManager(this.gridInstance.dataSource)
.executeQuery(new Query().search("VI",[]))
.then((e: ReturnOption) => {
var rows = e.result; //here we can get the search results
console.log(rows);
});
}
render() {
return (<div>
<button onClick={this.searchFunction.bind(this)}> Get search results</button>
<GridComponent id="Grid" dataSource={data} actionComplete={this.onComplete.bind(this)} toolbar={this.toolbarOptions} ref={g => this.gridInstance = g} height={240}>
<ColumnsDirective>
...
</ColumnsDirective>
<Inject services={[ Toolbar ]} />
</GridComponent></div>)
} |