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

Filter Template and Between function for dates

2 Answers 66 Views
Grid
This is a migrated thread and some comments may be shown as answers.
romulo~
Top achievements
Rank 1
romulo~ asked on 30 Dec 2015, 05:15 PM

Hello,

 

I'm having some trouble with my filter template on a GridDatetimeColumn. It's happenig only when I try the Between or NotBetween function.

The thing is:

I can normally call the method filter() from the table view client object.

I have all  parameters like this example:

1.// columnUnique = 'dateColumn'
2.// value = '01/12/2015 31/12/2015'
3.// cont = 11 (Between function from the Telerik.Web.UI.GridFilterFunction.Between)
4. 
5.tableView.filter(columnUnique, value, cond, true);

When this method is called, it's not fired to the server.

If I change the function to something like EqualsTo (in this case, the 31/12/2015 part is omitted and only the first part is used), the same method works fine.

In the grid setup, I set all date columns to EnableRangeFiltering = true;

 

I also tried the grid without my filter template to check the built-in funtion. That way, the command was fired on the server and the value was just like the example. ('01/12/2015 31/12/2015')

 

I need to use the template because of some requirements and the date column's is the only one that's giving more trouble.

Thanks for the help

2 Answers, 1 is accepted

Sort by
0
romulo~
Top achievements
Rank 1
answered on 30 Dec 2015, 06:53 PM

Well, it's the second time it happens... hehe :D

I tried something new, and it worked!!

 

In that code, I changed the int value of the Telerik.Web.UI.GridFilterFunction.Between to the string value "Between" and removed the last parameter since it didn't seen to influence.

 

 It doesn't make too much of sense for me, but I'll keep testing

 

1.// cond = 11 (value of Telerik.Web.UI.GridFilterFunction.Between)
2.tableView.filter(columnUnique, value, cond, true);
3. 
4.// changed to
5. 
6.// cond = 'Between' (value from my template combobox)
7.tableView.filter(columnUnique, value, cond);

0
Kostadin
Telerik team
answered on 04 Jan 2016, 09:49 AM
Hello Romulo,

I am not sure why the enumeration value is not working on your end. I prepared a small sample which works on my end when using an integer value and attached it to this thread. Could you please give it a try and let me know how it differs from your real setup?

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
Tags
Grid
Asked by
romulo~
Top achievements
Rank 1
Answers by
romulo~
Top achievements
Rank 1
Kostadin
Telerik team
Share this question
or