This question is locked. New answers and comments are not allowed.
The grid loses it's filtering when it is refreshed.
This happens both on my local implementation (where we restore grid filtering from a DB) and the current filtering demo [ http://demos.telerik.com/aspnet-mvc/Grid/Filtering?theme=vista ].
Steps to reproduce:
Can this please be fixed? Our implementation requires regular refreshes to keep the data up to date (done automatically with javascript) and this issue is causing problems.
This happens both on my local implementation (where we restore grid filtering from a DB) and the current filtering demo [ http://demos.telerik.com/aspnet-mvc/Grid/Filtering?theme=vista ].
Steps to reproduce:
- Filter the grid using the "Filter by..." box (not the built-in dropdown filter, which works fine)
- Click the "refresh" button, or call the client-side refresh method
- Note that despite the filter icon still being highlighted and having the filter entered, the grid data itself has reverted to its unfiltered state
Can this please be fixed? Our implementation requires regular refreshes to keep the data up to date (done automatically with javascript) and this issue is causing problems.
13 Answers, 1 is accepted
0
Hi Stephen,
Indeed this is a known issue. Find attached a patched version of telerik.grid.filtering.js. To use it simply overwrite the existing one.
Regards,
Atanas Korchev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items.
Indeed this is a known issue. Find attached a patched version of telerik.grid.filtering.js. To use it simply overwrite the existing one.
Regards,
Atanas Korchev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items.
0
Stephen
Top achievements
Rank 1
answered on 29 Mar 2010, 10:50 AM
Hi Atanas
Thanks for the supplied file, however the file you supplied seems to break datetime filtering; I get this error:
Error: c.datetime.parse is not a function
Source File: http://<projectroot>/Scripts/Telerik/telerik.grid.filtering.min.js
Line: 1
This occurs both when loading the grid with a preset datetime filter, or when attempting to filter the grid from the dropdown filter menus. Also, it sometimes seems to break the grid javascript completely.
Any ideas what could be causing this?
Thanks
Stephen
Thanks for the supplied file, however the file you supplied seems to break datetime filtering; I get this error:
Error: c.datetime.parse is not a function
Source File: http://<projectroot>/Scripts/Telerik/telerik.grid.filtering.min.js
Line: 1
This occurs both when loading the grid with a preset datetime filter, or when attempting to filter the grid from the dropdown filter menus. Also, it sometimes seems to break the grid javascript completely.
Any ideas what could be causing this?
Thanks
Stephen
0
Hello Stephen,
I am sending you all script files. Let me know if you still have problems.
Kind regards,
Atanas Korchev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items.
I am sending you all script files. Let me know if you still have problems.
Kind regards,
Atanas Korchev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items.
0
Stephen
Top achievements
Rank 1
answered on 29 Mar 2010, 11:35 AM
Hi Atanas,
The error still occurs but the signature has changed:
Error: c.datetime.parse(f, e(h)) is null
Source File: http://<project root>/Scripts/Telerik/telerik.grid.filtering.min.js
Line: 1
This only occurs on DateTime filtering. All other filters still work.
Regards
Stephen
The error still occurs but the signature has changed:
Error: c.datetime.parse(f, e(h)) is null
Source File: http://<project root>/Scripts/Telerik/telerik.grid.filtering.min.js
Line: 1
This only occurs on DateTime filtering. All other filters still work.
Regards
Stephen
0
Stephen
Top achievements
Rank 1
answered on 29 Mar 2010, 12:19 PM
Hi Atanas,
I note that the JS files have changed quite a bit - perhaps there are changes required to the C# files as well? If so please let me know what needs to be changed so I can update the reference project.
For your information, we are using MVC v1 and the (current) 2010.1.309 Telerik MVC release (which we downloaded on the 19th March). We're using jQuery 1.4.2.
HTH
-S
I note that the JS files have changed quite a bit - perhaps there are changes required to the C# files as well? If so please let me know what needs to be changed so I can update the reference project.
For your information, we are using MVC v1 and the (current) 2010.1.309 Telerik MVC release (which we downloaded on the 19th March). We're using jQuery 1.4.2.
HTH
-S
0
Hello Stephen,
I am sending a sample application which works fine on my end. You can try using the dll and JavaScript files used in it.
Regards,
Atanas Korchev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items.
I am sending a sample application which works fine on my end. You can try using the dll and JavaScript files used in it.
Regards,
Atanas Korchev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items.
0
Stephen
Top achievements
Rank 1
answered on 29 Mar 2010, 02:15 PM
Hi Atanas
Thanks for providing that, but could the project be supplied in MVC 1 instead of MVC 2? It is the MVC 1 version we are having the problem with, and we are currently unable to upgrade our client environment to MVC 2.
Thanks
Stephen
Thanks for providing that, but could the project be supplied in MVC 1 instead of MVC 2? It is the MVC 1 version we are having the problem with, and we are currently unable to upgrade our client environment to MVC 2.
Thanks
Stephen
0
Hello Stephen,
I am sending the MVC1 dll. You can easily use the controller and aspx from the MVC2 example.
All the best,
Atanas Korchev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items.
I am sending the MVC1 dll. You can easily use the controller and aspx from the MVC2 example.
All the best,
Atanas Korchev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items.
0
Stephen
Top achievements
Rank 1
answered on 29 Mar 2010, 04:33 PM
Hi Atanas
Okay I've tracked down where the issue occurs. We were formatting our DateTime columns to make them UK-style display, i.e.:
When we do this the JS error occurs when attempting to filter the column.
We have also found a workaround; We've changed our code to use the new culture localization options introduced with the most recent release instead of the Format string, and that appears to have resolved the issue... not sure if you would consider the strange behaviour with format a bug, but at least we have a viable workaround now. Might be useful to you guys in the future!
Thanks for your help with this issue.
-Stephen
Okay I've tracked down where the issue occurs. We were formatting our DateTime columns to make them UK-style display, i.e.:
| Html.Telerik().Grid<PROJROOT.Models.OrderViewModel>() |
| .Name("Grid") |
| .Columns(columns => |
| { |
| columns.Bound(o => o.OrderDate).Format("{0:dd/MMM/yyyy HH:mm:ss}"); |
| }) |
When we do this the JS error occurs when attempting to filter the column.
We have also found a workaround; We've changed our code to use the new culture localization options introduced with the most recent release instead of the Format string, and that appears to have resolved the issue... not sure if you would consider the strange behaviour with format a bug, but at least we have a viable workaround now. Might be useful to you guys in the future!
Thanks for your help with this issue.
-Stephen
0
Hello Stephen,
The aforementioned JS error was thrown, because the parse() method of the datepicker could only dates without time. Thus when you set date format with time the result was null.
I am glad to inform you that we improve the date parsing and now it accepts date formats with time. The improvement will be included in the next release.
For your convenience I have attached the latest internal build of the Telerik Components for ASP.NET MVC.
Kind regards,
Georgi Krustev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items.
The aforementioned JS error was thrown, because the parse() method of the datepicker could only dates without time. Thus when you set date format with time the result was null.
I am glad to inform you that we improve the date parsing and now it accepts date formats with time. The improvement will be included in the next release.
For your convenience I have attached the latest internal build of the Telerik Components for ASP.NET MVC.
Kind regards,
Georgi Krustev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items.
0
Stephen
Top achievements
Rank 1
answered on 31 Mar 2010, 04:53 PM
Hi Georgi,
Thanks for the updated files, however we had to make a minor change to make this work properly in our use case. In the FilterParser.cs we changed the ParseDateTimeExpression() method format string from hh to HH (so it looks as follows):
We also updated the telerik.filtering.js in a similar manner, changing encodeFilterValue to return:
This was to prevent the grid from attempting to convert 24h time values into 12h ones (and getting them wrong)... Again, this could be something that is specific to our implementation but we thought you might want to be aware that there can be problems with the time parsing as-is.
Thanks again for the great support!
-Stephen
Thanks for the updated files, however we had to make a minor change to make this work properly in our use case. In the FilterParser.cs we changed the ParseDateTimeExpression() method format string from hh to HH (so it looks as follows):
| private IFilterNode ParseDateTimeExpression() |
| { |
| FilterToken dateTime = Expect(FilterTokenType.DateTime); |
| return new DateTimeNode |
| { |
| //The actual XSD date format is yyyy-MM-ddTHH:mm:ss but ":" generates BAD REQUEST HTTP code when send via GET. |
| //That's why we are using yyyy-MM-ddTHH-mm-ss |
| Value = DateTime.ParseExact(dateTime.Value, "yyyy-MM-ddTHH-mm-ss", null) |
| }; |
| } |
We also updated the telerik.filtering.js in a similar manner, changing encodeFilterValue to return:
| return "datetime'" + $t.formatString('{0:yyyy-MM-ddTHH-mm-ss}', date) + "'"; |
This was to prevent the grid from attempting to convert 24h time values into 12h ones (and getting them wrong)... Again, this could be something that is specific to our implementation but we thought you might want to be aware that there can be problems with the time parsing as-is.
Thanks again for the great support!
-Stephen
0
Hello Stephen,
Thank you for getting back to us and for the suggested change in the code. I confirm that the suggested fix will be included in the next release of Telerik Components for ASP.NET MVC.
Regards,
Georgi Krustev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items.
Thank you for getting back to us and for the suggested change in the code. I confirm that the suggested fix will be included in the next release of Telerik Components for ASP.NET MVC.
Regards,
Georgi Krustev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items.
0
Jindrich
Top achievements
Rank 1
answered on 19 Jun 2011, 07:48 AM
Hallo Collegue,
I have similar situation:I am using version MVC 2011.1.315,
if I use datetime grid filter with format "{0:MM-yyyy}", same parse error occurs. It I extend it with "dd" somewhere, so it works.
regards,
J.Matouš
I have similar situation:I am using version MVC 2011.1.315,
if I use datetime grid filter with format "{0:MM-yyyy}", same parse error occurs. It I extend it with "dd" somewhere, so it works.
regards,
J.Matouš