This question is locked. New answers and comments are not allowed.
I think I have found a possible bug in the Telerik MVC grid.
Where Person is:
Note the value of the filter for DateOfBirth. When it gets to the parsing of this value in telerik.grid.filter.js on line 238, method parseDate, this blows up and the resultant URL has
If you filter by datetime, then filter by anything else and the URL is incorrect. My controller is:
| [GridAction] |
| public ActionResult Index(GridCommand command) |
| { |
| IQueryable<Person> ppl = GetData(); |
| return View(ppl); |
| } |
| public class Person |
| { |
| public string Name { get; set; } |
| public DateTime DateOfBirth { get; set; } |
| } |
I've setup the style and script registrars then my view is:
| <asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server"> |
| <% Html.Telerik().Grid(Model).Name("Grid").Filterable().Render(); %> |
| </asp:Content> |
This creates the grid as expected. When you filter on a datetime, it works but the resulting page has this generated by the script registrar:
| jQuery('#Grid').tGrid({columns:[{"name":"Name","type":"String"}, |
| {"name":"DateOfBirth","type":"Date","filters":[{"operator":"eq","value":"\/Date(398296800000)\/"}]}], plugins:["gridFilter"], urlFormat:'/?Grid-page=%7B0%7D&Grid-orderBy=%7B1%7D&Grid-filter=%7B2%7D', pageSize:0});}); |
DateOfBirth~eq~datetime'NaN-NaN-NaNT12-NaN-NaN'
I'm using the latest Telerik MVC Build Telerik_Extensions_for_ASPNET_MVC_2009_3_1320_OpenSource.