|
[index.js]
var grid = new ej.grids.Grid({
dataSource: window.hierarchyOrderdata,
toolbar: ["Search"],
-----
dataBound: dataBound,
----
});
grid.appendTo("#Grid");
function dataBound(args) {
// get the search bar element and bind the keyup event
this.element.querySelector("#" + this.element.getAttribute("id") + "_searchbar .addEventListener("keyup", function(e) {
setTimeout(
() => this.closest(".e-grid").ej2_instances[0].search(this.value),
1500); // perform search operation in Grid after certain time interval for avoid multiple request and you can change based on your application
});
} |