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

DataSource filter - value is undefined

3 Answers 908 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
nickspiers
Top achievements
Rank 1
nickspiers asked on 05 Mar 2015, 04:32 PM
I'm trying to implement a custom filter on a DataGrid using a DropDownList.

When I filter a DataSource using a custom operator delegate, I get a "Reference Error: value is not defined" where value = whatever the actual value is that I'm trying to use to filter.

http://jsfiddle.net/v73fLpb4/6/

Try selecting London in the drop down and you'll see "ReferenceError: London is not defined" in your error console.
Am I doing something wrong?

3 Answers, 1 is accepted

Sort by
0
nickspiers
Top achievements
Rank 1
answered on 05 Mar 2015, 04:33 PM
0
Accepted
Scott
Top achievements
Rank 1
answered on 06 Mar 2015, 07:05 PM
I've been struggling to get something similar working for the last few days. Best I can tell, using a function operator makes Kendo expect a function value as well. Problem is, that function gets executed on the window context so I can't use it to access any of my locally defined variables. You can get around that by scrapping the value declaration entirely and just grabbing your val variable in the operator function.

I can't find much of anything in the API docs describing the function variants of the operator/value/field declarations on datasource filters.
0
nickspiers
Top achievements
Rank 1
answered on 06 Mar 2015, 09:55 PM
Thanks Scott,
That workaround worked for me. It introduced some issues in other parts of my application that are looking at the filter's values but I was able to work around those as well.
Tags
Data Source
Asked by
nickspiers
Top achievements
Rank 1
Answers by
nickspiers
Top achievements
Rank 1
Scott
Top achievements
Rank 1
Share this question
or