Hi Akshatha,
Greetings from syncfusion support
Query#: When I search with leading spaces, search result shows no records
We have analyzed your query and we could see that you like to trim the white space in the filter menu. You can perform this operation for auto complete filter by modifying the filter query with the trimmed value and passing it to the updateData method of the autocomplete’s filtering event in the grid’s actionComplete function. Please refer the below code example and sample for more information.
|
// Grid’s autoComplete event function
complete(args) {
// Check if request type is ‘filterafteropen’
if (args.requestType === 'filterafteropen'){
if (args.columnType === 'string') {
// Bind filtering event to the autocomplete
(document.getElementsByClassName('e-autocomplete')[0] as any).ej2_instances[0].filtering =
function(args) {
// Trim the text value to remove white spaces
args.text = args.text.replace(/\s/g, "");
let query: Query = new Query();
// frame the query based on search string with filter type.
query = (args.text !== '') ? query.where('CollectorName', 'contains', args.text, true) : query;
// pass the filter data source, filter query to updateData method.
args.updateData(this.dataSource.dataSource.json, query);
}
}
}
}
|
Screenshot:
Query#: How to implement progressive search for syncfusion grid
In this query you have mentioned that “progressive search for syncfusion grid”. Based on your query we suspect that you like to search the record which was not exist in the current page. By default in our EJ2 Grid, the search was done based on the datasource. So it will search your record which was not exist your current view and display the result.
By default when performing search operation in Grid UrlAdaptor it sends the key value to the server. Based on that key value you have to handle the search operation from your server side and you need to return the data as JSON from the controller action and the JSON object must contain a property as result with dataSource as its value. In the server side, once the searching is done we have perform the skip and take operation based on that searched datasource .Please refer the below sample and screenshot for more information.
Screenshot:
If we misunderstood anything wrongly, Please share us your requirement with detailed description.
Regards,
Rajapandi R