|
public query: Query = new Query().from("Customers").select(["ContactName", "CustomerID"]).take(6);
// maps the appropriate column to fields property
public fields: Object = { text: "ContactName", value: "CustomerID", itemCreated: (e: any) => {
highlightSearch(e.item, this.queryString, true, "Contains");
}
};
// set the placeholder to the DropDownList input
public text: string = "Select a customer";
//sort the result items
public sorting: string = "Ascending";
public queryString: string;
//Bind the filter event
public onFiltering: any = (e: FilteringEventArgs) => {
// take text for highlight the character in list items.
this.queryString = e.text;
let query: Query = new Query().from("Customers").select(["ContactName", "CustomerID"]);
query = e.text !== "" ? query.where("ContactName", "startswith", e.text, true) : query;
e.updateData(this.data, query);
}; |