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

[Solved] MVC4 + batch editing Grid + TimePicker doesn't work

3 Answers 62 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mathias
Top achievements
Rank 1
Mathias asked on 06 Apr 2012, 10:41 AM

Hello,

 

We upgraded a Telerik MVC3 project to MVC 4 based on this article. But as soon as you upgrade a project to MVC4 it seems that the validation of the TimePicker in batch editing Grids doesn't work correctly anymore. When you click at the watch of the TimePicker it always says "The field <field>  must be a date."

 

I attached a sample MVC4 project. Same project with MVC3 works correctly. So far I haven't tested if this problem only occurs in batch editing mode of the grid.

 

I know that you don't support MVC4 by now but you should probably have a look at this in the future.

Is there any workaround we could use right now or do we have to downgrade our project? By far everything worked fine with MVC4. This was the first issue we had.

 

Mathias

3 Answers, 1 is accepted

Sort by
0
Accepted
Petur Subev
Telerik team
answered on 09 Apr 2012, 08:17 AM
Hi Mathias,

It seems that there is some date validation performed on the client for the date cell.
Since we still do not support MVC 4 you can try to get rid of that validation being performed (instead of disabling the whole client validation) by modifying the the date validation method on the page load event.
from:
$.validator.methods.date = function (a,b){ return this.optional(b)||!/Invalid|NaN/.test(new Date(a))}
to:
$.validator.methods.date = function (a,b){ return true;}
I hope this works for you.

Kind Regards,
Petur Subev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
Mathias
Top achievements
Rank 1
answered on 10 Apr 2012, 12:31 PM
Hi Petur,

thanks for your answer. Seems to be working - but it deactivates the complete validation of date-fields, right? Seems to be not the best solution, but hopefully this problem doesn't occur in future releases anymore (as soon as you support MVC4)

Tank you,
Mathias
0
Petur Subev
Telerik team
answered on 10 Apr 2012, 03:13 PM
Hi again Mathias,

Yes for that particular page the dates wont be validated on the client. Once the MVC4 is officially released and we start supporting it such glitches will be troubleshooted.

Regards,
Petur Subev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
Tags
Grid
Asked by
Mathias
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Mathias
Top achievements
Rank 1
Share this question
or