|
// maps the appropriate column to fields property
public fields: Object = {
text: "Name",
value: "Code",
itemCreated: (e: any) => {
highlightSearch(e.item, this.queryString, true, "StartsWith");
}
};
// filtering event handler to filter a Country
public onFiltering: EmitType<FilteringEventArgs> = (
e: FilteringEventArgs
) => {
// take text for highlight the character in list items.
this.queryString = e.text;
let query: Query = new Query();
//frame the query based on search string with filter type.
query =
e.text !== "" ? query.where("Name", "startswith", e.text, true) : query;
//pass the filter data source, filter query to updateData method.
e.updateData(this.data, query);
};
} |