DataSource filter - value is undefined

4 posts, 1 answers
  1. nickspiers
    nickspiers avatar
    3 posts
    Member since:
    Feb 2012

    Posted 05 Mar 2015 Link to this post

    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?
  2. nickspiers
    nickspiers avatar
    3 posts
    Member since:
    Feb 2012

    Posted 05 Mar 2015 in reply to nickspiers Link to this post

  3. Kendo UI is VS 2017 Ready
  4. Answer
    Scott
    Scott avatar
    14 posts
    Member since:
    Mar 2013

    Posted 06 Mar 2015 Link to this post

    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.
  5. nickspiers
    nickspiers avatar
    3 posts
    Member since:
    Feb 2012

    Posted 06 Mar 2015 in reply to Scott Link to this post

    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.
Back to Top
Kendo UI is VS 2017 Ready