- Home
- Forum
- ASP.NET Core
- Turn of autocomplete in Filter Menu
Turn of autocomplete in Filter Menu
I have a Grid with a data source that has millions of records. I use the UrlAdaptor with paging to avoid querying the whole table. I added a Menu Filter to the columns of the grid. Now when I start typing in the text box the system runs a query with RequiresCounts = false, Skip=0 and Take=0 when . This results in a full table query which takes up to 30 seconds. My guess is this is to populate the suggestions dropdown.
Is there a way to stop this query from running at the View. If not then I guess I can trap this situation in the controller and just return no records.
Regards
Jim
SIGN IN To post a reply.
3 Replies
SA
Saravanan Arunachalam
Syncfusion Team
August 30, 2017 08:37 AM UTC
Hi James,
Thanks for contacting Syncfusion’s support.
We have analyzed your requirement, we understood from your query, you need to place the ejDropDownList instead of ejAutoComplete in the menu filter dialog and we have already discussed this query in the following knowledge base document.
Or, if you want to render the ejAutoComplete with empty record, we suggest you to set the empty array to its dataSource which doesn’t make the post back for autocomplete’s search and it does show the empty suggestion list. Please refer to the below code example.
|
function create(args){ //Create event of Grid control
this.element.on("mousedown", ".e-gridheader .e-filtericon", function () {
$("#Grid_stringDlg").ejDialog({
//open event of the filter menu dialog
open: function (e) {
var dp = this.element.find(".e-autocomplete"), instance;
if (dp.length) {
instance = dp.data("ejAutocomplete");
instance.option("model.dataSource", []);
}
}
});
})
}
|
Regards,
Saravanan A.
JW
James Wilkinson
August 30, 2017 02:10 PM UTC
Thanks.
I opted for setting the dataSource to null. But I had to add the following inside the "if" statement to remove the annoying "No suggestions" results box.
instance.option("model.showEmptyResultText", false);
Jim
SA
Saravanan Arunachalam
Syncfusion Team
August 31, 2017 05:11 AM UTC
Hi James,
Thanks for your update.
Yes, you can set the “showEmptyResultText” as false to hide the suggestion box and we are also happy that the provided information helped you.
Regards,
Saravanan A.
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
JW James Wilkinson
- Aug 30, 2017 12:51 AM UTC
- Aug 31, 2017 05:11 AM UTC