Cannot set columns.filterable.cell.template to function

3 posts, 1 answers
  1. Fillip
    Fillip avatar
    8 posts
    Member since:
    Nov 2013

    Posted 22 Jun Link to this post

    I have a grid that I initalize via the .NET wrapper. I can do the following:

    columns.Bound(r => r.SampleColumn).ClientGroupHeaderTemplate("#= myFunction2(data, 50) #")

    But I can't do this:

    columns.Bound(r => r.SampleColumn).Filterable(f => f.Cell(c => c.Template("#= myFunction1(data, 100) #")))

    I get a JS error. Any idea why? I would like to pass in an additional variable on the view.

  2. Answer
    Kostadin avatar
    1689 posts

    Posted 27 Jun Link to this post

    Hello Fillip,

    You can use the following approach to access the filter datasource.
    columns.Bound(r => r.SampleColumn).Filterable(f => f.Cell(c => c.Template("function(args){ myFunction1(args, 100)}")));

    Additionally you can find more information in the grid API.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET AJAX banner
  4. Fillip
    Fillip avatar
    8 posts
    Member since:
    Nov 2013

    Posted 28 Jun in reply to Kostadin Link to this post

    Good idea Kostadin! I didn't think to create a function expression in the string. Thanks!
Back to Top