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

Filter with no match stops the filter input field from showing

1 Answer 18 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Patrick asked on 13 Nov 2015, 02:15 PM

Hello, I'm using a single DropDownList which is bound to remote data. It all works fine except from when the filter string doesn't match with any records in the database. How to reporoduce a bug, step by step:

1. Click on the data bound DropDownList component.

2. Write a filter string that returns no records

3. Click outside of the component to DropDownList close it

4. (issue) Click again to "open" the DropDownList component and change the filter --> after a loading gif stops spinning, the component isn't shown nor the filter input field


How to fix the issue?

A workaround came to my mind where I could modify the results when server would return 0 rows to insert a single row with some rubbish data but that is not acceptable.

 Component setup:

02.      filter: "startswith",
03.      dataTextField: "customer_name",
04.      dataValueField: "id",
05.      dataSource: {
06.          type: "json",
07.          serverFiltering: true,
08.          transport: {
09.              read: function(options) {
10.                $.ajax({
11.                  url: "api/serviceXY.php",
12.                  dataType: "json",
13.                  type: 'post',
14.                  data: 'filter=' + customerFilter,
15.                  success: function(result) {
16.                    options.success(result);
17.                  },
18.                  error: function(result) {
19.                    options.error(result);
20.                  }
21.                });
22.              }
23.          }
24.      },
25.      filtering: function(e) {
26.        if (typeof e.filter !== 'undefined') {
27.          console.log(e.filter);
28.            customerFilter = e.filter.value;
29.        }
30.      }
31.  });

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 17 Nov 2015, 09:05 AM
Hello Patrick,

I am afraid that I was unable to replicate the described issue, base on the provided information and code snippet. This is why, I would like to ask you to provide us with a sample dojo, where your implementation is applied and the problematic behavior resides. Thus we would be able to replicate it and determine whether it is a bug.

Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question