asp.net mvc - MVC Grid with a datepicker - what is the best way? -


I have already asked how to put a datepicker in a grid, and I did not get any response. I came to know that the way I did it was not working, because the ID of all the fields in the same column was identical. So when I put it on a date, the first field was updated in only one column. I sent a message that how to set an id of a field to prevent this, but nobody wanted to know. So I'm now looking at the Juke Grid and the MVC Containerb Grid. I am new to both and I am worried that I will take some time to find out. Which should I use?

* Edit This is some additional information that where I am looking I have an antecedent and I present a partial approach;

  & lt; Tr & gt; & Lt; Td> & Lt;%: Model T. BankholdDown% & gt; & Lt; / Td> & Lt; Td> & Lt;%: Html.EditorFor (model = & gt; model .bh.freebank holidays)% & gt; & Lt; / Td> & Lt; Td> & Lt;%: Html.EditorFor (model = & gt; model.b. bank banknote comment)% & gt; & Lt; / Td> & Lt; / TR & gt;  

I have an editor template to assign datepicker for the date field;

  & lt;% @ Control language = "C #" Inherits = "System.Web.Mvc.ViewUserControl & LT; System.DateTime>?" & Gt%; & Lt;%: Html.TextBox ("", (Model.HasValue? Model.Value.ToShortDateString (): string.Empty), New {@class = "datePicker"})% & gt;  

The problem I have is that the ID is identical to every NullableBankHolidayDate field in the grid. So when I select a date, then the first field of the column is given to choose one .

You can basically need that with JQuery and a standard grid. Set up a class attribute on your text box, if you want to update, set jquery to add a datacic to those classes - instead of element id.

For example - assuming that you are using the JQUi UI Datapiker.

  & lt;% foreach (Model myObject) {%> & Lt; TR & gt; & Lt; Td> & Lt;% = Html.TextBox ("MyProperty", myObject.MyProperty, new {@class = "date"})% & gt; & Lt; / Td> & Lt; / TR & gt; & Lt;%}% & gt; & Lt; Script type = "text / javascript" & gt; $ (Function () {$ ('.date'). (Function () {$ (this) .removeClass ('dadipiker'). Datepicker ();});}); & Lt; / Script & gt;  

Comments