Hi!
I have 2 different elements that i want to work together with filtering a grid.
1 Autocomplete (Works as a search function) and 1 ComboBox
When i select a filter in the comboBox i want it to filter the the grid and include the filter in the combobox.
Here is my code now for filtering separate:
I have 2 different elements that i want to work together with filtering a grid.
1 Autocomplete (Works as a search function) and 1 ComboBox
When i select a filter in the comboBox i want it to filter the the grid and include the filter in the combobox.
Here is my code now for filtering separate:
function autoComplete_selected(arg) {
var value = this.value();
var grid = $("#GridField").data('kendoGrid');
if (value) {
grid.dataSource.filter({ field: "SalonName", operator: "contains", value: value });
}
else {
grid.dataSource.filter({});
}
}
//
// Filter by ComboBox
function selectFilterComboBox(arg) {
var grid = $("#GridField").data('kendoGrid');
var dataItem = this.dataItem(arg.item.index());
if (dataItem.Value != null) {
grid.dataSource.filter({ field: "StatusId", operator: "eq", value: parseInt(dataItem.Value) });
}
else {
grid.dataSource.filter({});
}
}