Out of the box, the ComboBox supports filter values are startswith, endswith and contains. Our requirement needs a more complex filtering mechanism. Our data source will be something looks like
[{name: "Pennsylvania State University", id: 1}, {name: "University of Pennsylvania", id: 2}, {name: "Princeton University", id: 3}]
When user enters "penn univ", we want the filter result to be
[{name: "Pennsylvania State University", id: 1}, {name: "University of Pennsylvania", id: 2}]
This needs a dynamically generated filter like
{ logic: "and",
filters:[{ field: "name", operator: "contains", value: "penn"},
{ field: "name", operator: "contains", value: "univ"}
]
}
Is it possible for us to pass a function which returns such a filter with a dynamically generated filter array inside? Or is it has to be predefined string? If we can, how do we split the user input into string array and pass the parts in as value respectively?
Is it possible to capture the keyup event of the input, and filter the data source separately?
[{name: "Pennsylvania State University", id: 1}, {name: "University of Pennsylvania", id: 2}, {name: "Princeton University", id: 3}]
When user enters "penn univ", we want the filter result to be
[{name: "Pennsylvania State University", id: 1}, {name: "University of Pennsylvania", id: 2}]
This needs a dynamically generated filter like
{ logic: "and",
filters:[{ field: "name", operator: "contains", value: "penn"},
{ field: "name", operator: "contains", value: "univ"}
]
}
Is it possible for us to pass a function which returns such a filter with a dynamically generated filter array inside? Or is it has to be predefined string? If we can, how do we split the user input into string array and pass the parts in as value respectively?
Is it possible to capture the keyup event of the input, and filter the data source separately?