Hi Grant,
Thanks for contacting Syncufsion support.
Query: Is there a way to add that OnKeyUp flag to the input tag generated by the Syncfusion grid
We have analyzed your requirement and by default, we don’t have any build in functionality for this. However, you can achieve your requirement by using the below way. In the below code example, we have bind the keyUp event for search input element in created event and based on the search value we have performed the search operation in Grid by using the search method.
Kindly refer to the below code example and documentation for more information.
<div>
@Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.dataSource).Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).Width("120").Add();
col.Field("CustomerID").HeaderText("Customer Name").Width("150").Add();
}).AllowPaging().Toolbar(new List<string>() { "Search" }).Created("search").Render()
</div>
<script>
function search() {
// Grid - > id of the Grid component you can set based on you requirement
document.getElementById("Grid_searchbar").addEventListener('keyup', function (event) {
var value = event.target.value;
gridObj = document.getElementById('Grid').ej2_instances[0];
gridObj.search(value)
})
}
</script> |
Help documentation :
Regards,
R.Dhivya