javascript - Editable Grid: Multiple datepickers -
i'm constructing view user can edit date of each item model store
, i'm using jqueryui datepicker js.
this view (extract):
@model ienumerable<application.models.store> @foreach (var item in model) { <input type="text" class="datepicker form-control" asp-for="@item.designateddate" name="designateddate" form="@(string.format("{0}{1}","form",item.storeid))" />
and js:
<script> $(function () { $(".datepicker").datepicker(); }); </script>
since i'm showing multiple stores in grid, each 1 has it's own date picked.
the problem i'm having datepickers linked between each other since each input has:
asp-for="@item.designateddate"
which translates to:
id="item_designateddate"
note: use asp-for="@item.designateddate"
in order show current date store has registered when pages loads.
and so, when change date of store, change date of first store, always.
any idea on how fix this?
thanks in advance!
solved.
i had add id each in order differentiated:
id="@(string.format("{0}{1}","any",item.storeid))"
and works.
Comments
Post a Comment