This is a migrated thread and some comments may be shown as answers.

Issues filtering autosuggestions

2 Answers 57 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 01 May 2020, 09:33 AM

I have a table of medical data, and a filter for each of the columns. I am trying to filter the autosuggestions of the second filter (the one for the description), so that it only suggests items which match the already input Area. If you check out this CodePen it probably makes more sense: https://codepen.io/thomasfarleigh/pen/dyYVbRd

 

If you enter 'Lip' into the Area input, you will see that the autosuggestions available for the Description are Neoplasm, and Tumor cells which is perfect, as they are two descriptions that match Lip. However if you enter 'Base of tongue' into the area input, the only autosuggestion you get is 'Something different' and not Neoplasm which is also a match for Base of tongue.

 

I'm really can't figure out why this is happening. Is the filter function already associating Neoplasm with Lip even though it matches both items? Would appreciate any guidance.

 

I am using this function which gets called by the dataBound event:
function filterAutoCompleteDataSource(e) {
  var gridFilter = e.sender.dataSource.filter();
  $("#grid").data("kendoGrid").thead.find('span[data-field="HistologyBehaviorDescription"] input[data-role="autocomplete"]').data().kendoAutoComplete.dataSource.filter(gridFilter);
}

2 Answers, 1 is accepted

Sort by
0
Thomas
Top achievements
Rank 1
answered on 01 May 2020, 02:34 PM
I have narrowed down the issue. As mentioned in the info bit here: https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/filterable.mode, "The AutoComplete dataSources do not perform paging and will use a collection of the unique column values only." So this means that when a description is already used up by one area, it doesn't show up for others in the autosuggestions. Is there a way to change this or another way to solve the problem?
0
Nikolay
Telerik team
answered on 05 May 2020, 08:58 AM

Hello Thomas,

Thank you for sharing the codepen demo. 

I examined it and noticed that upon typing "BASE OF TONGUE" in the Area column filter input the result is correctly returned including "Neoplasm, malignant" and "Something different":

Is it possible that I am missing something? I have transferred the codepen code into a Dojo environment for a more convenient way of tracking the code. 

Please keep me updated.

Regards,
Nikolay
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Filter
Asked by
Thomas
Top achievements
Rank 1
Answers by
Thomas
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or