Reputation: 269
I have a kendo grid with custom toolbar template, my drop down list have only one float value Now I want filter grid by that value and a column ( not ID) and get greater than or less than. How can I do ( I work with kendo-asp.net-mvc )
Upvotes: 2
Views: 4095
Reputation: 306
If I've understood correctly, you want to filter your grid based on a value from a dropdown.
You can add a handler to your search button click event that fills the grid filters and then filters the grid:
$( function () {
$( "#btnSearch" ).click( function ( e ) {
e.preventDefault();
$filter = new Array();
$dropdownValue = $( "#YOUR_DROPDOWN_ID" ).val();
if ( $dropdownValue ) {
$filter.push( { field: "GRID_FIELD", operator: "gt", value: $dropdownValue } );
$filter.push( { field: "GRID_FIELD", operator: "lt", value: $dropdownValue } );
}
var grid = $( "#Grid" ).data( "kendoGrid" );
grid.dataSource.filter( $filter );
} );
} );
Upvotes: 2