erichexter / twitter.bootstrap.mvc

nuget package to make bootstrap easy with mvc4
Apache License 2.0
248 stars 134 forks source link

Model editor does not display Start Date #77

Open plwade opened 11 years ago

plwade commented 11 years ago

Hi Eric, I'm having problems getting the model Edit to work showing the existing Start Date (see attached screenshot).

Also..... Is it possible to have dates edited with a Calendar DatePicker rather than a TextBox?

Any help appreciated.

Regards, Paul Screenshot

erichexter commented 11 years ago

You can create a editor template using the out of the box mvc functionality

Eric Hexter

blog | http://Hex.LosTechies.com info | http://www.linkedin.com/in/erichexter

On Fri, Mar 1, 2013 at 3:38 PM, plwade notifications@github.com wrote:

Hi Eric, I'm having problems getting the model Edit to work showing the existing Start Date (see attached screenshot).

Also..... Is it possible to have dates edited with a Calendar DatePicker rather than a TextBox?

Any help appreciated.

Regards, Paul [image: Screenshot]https://f.cloud.github.com/assets/3742666/211510/245fee8c-82b8-11e2-8cc7-57d956cda2c4.jpg

— Reply to this email directly or view it on GitHubhttps://github.com/erichexter/twitter.bootstrap.mvc/issues/77 .

plwade commented 11 years ago

Hi Eric, Thanks for getting back to me. re. create a editor template - Does this mean there is a problem with the example application regarding the display/edit of the Start date? I really would like to get the example app working, so any help appreciated. Regards, Paul.

Date: Fri, 1 Mar 2013 14:39:43 -0800 From: notifications@github.com To: twitter.bootstrap.mvc@noreply.github.com CC: pl_wade@hotmail.com Subject: Re: [twitter.bootstrap.mvc] Model editor does not display Start Date (#77)

You can create a editor template using the out of the box mvc functionality

Eric Hexter

blog | http://Hex.LosTechies.com

info | http://www.linkedin.com/in/erichexter

On Fri, Mar 1, 2013 at 3:38 PM, plwade notifications@github.com wrote:

Hi Eric, I'm having problems getting the model Edit to work showing the

existing Start Date (see attached screenshot).

Also..... Is it possible to have dates edited with a Calendar DatePicker

rather than a TextBox?

Any help appreciated.

Regards, Paul

[image: Screenshot]https://f.cloud.github.com/assets/3742666/211510/245fee8c-82b8-11e2-8cc7-57d956cda2c4.jpg

Reply to this email directly or view it on GitHubhttps://github.com/erichexter/twitter.bootstrap.mvc/issues/77

.

— Reply to this email directly or view it on GitHub.

serra commented 11 years ago

I'll post an example how to do this later today (not at all difficult); not sure if it should be part of the project though. IMO there's no "problem" regarding the editing of datetime fields - it's just not implemented. And since Twitter.Bootstrap doesn't provide a date(time)picker (afaik) it shouldn't be. You can use whatever datetime picker you find fit with this project.

plwade commented 11 years ago

Hi Marjin, I'll keep an eye out for your post. Thanks for getting back to me so soon. Regards, Paul. Date: Sun, 3 Mar 2013 23:20:00 -0800 From: notifications@github.com To: twitter.bootstrap.mvc@noreply.github.com CC: pl_wade@hotmail.com Subject: Re: [twitter.bootstrap.mvc] Model editor does not display Start Date (#77)

I'll post an example how to do this later today (not at all difficult); not sure if it should be part of the project though. IMO there's no "problem" regarding the editing of datetime fields - it's just not implemented. And since Twitter.Bootstrap doesn't provide a date(time)picker (afaik) it shouldn't be. You can use whatever datetime picker you find fit with this project.

— Reply to this email directly or view it on GitHub.

serra commented 11 years ago

The HomeInputModel.StartDate is annotated with DataType.Date, which renders an input typed Date. Some browsers render a datepicker, but some others don't. If you want to guarantee a date picker, you can create an editor in ~/Views/Shared/EditorTemplates named Date.cshtml and hook this to your preferred datepicker (I chose bootstrap-datepicker). Content of Date.cshtml:

@model DateTime
@Html.TextBox("", Model, new {@class = "datepicker"})

For more details, see my blog post

serra commented 11 years ago

@plwade - I don't think support for custom editors should be added to this project. If you agree and the above approach works for you, please close this issue.