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

Cannot set columns.filterable.cell.template to function

2 Answers 176 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Fillip
Top achievements
Rank 1
Fillip asked on 23 Jun 2016, 01:35 AM

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 Answers, 1 is accepted

Sort by
0
Accepted
Kostadin
Telerik team
answered on 27 Jun 2016, 07:24 AM
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.

Regards,
Kostadin
Telerik
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
0
Fillip
Top achievements
Rank 1
answered on 28 Jun 2016, 10:38 PM
Good idea Kostadin! I didn't think to create a function expression in the string. Thanks!
Tags
Grid
Asked by
Fillip
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Fillip
Top achievements
Rank 1
Share this question
or