Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="editorRows">
- <div id="tabs">
- <ul>
- @foreach (var item in Model.woundList)
- {
- <li><a href="#@item.ID">@item.tabName</a></li>
- }
- </ul>
- @for (int i = 0; i < Model.woundList.Count(); i++)
- {
- count= i;
- <div id="@Model.woundList[i].ID" >
- @Html.EditorFor(model => model.woundList[i])
- </div>
- }
- <input type="hidden" id="hdnIndex" value="@count.ToString()" />
- </div>
- </div>
- function addTab(title, uri) {
- debugger;
- var tabTitle = title;
- var count;
- if (document.getElementById("hdnIndex") != null
- && document.getElementById("hdnIndex") != undefined) {
- count = parseInt(document.getElementById("hdnIndex").value);
- count = count + 1;
- tabTitle = tabTitle + "-" + count;
- document.getElementById("hdnIndex").value = count;
- }
- var newTab = $("#tabs").tabs("add", uri, tabTitle);
- }
- <input id="btnAddTab" type="button" onclick="addTab('New Wound','@Url.Action("BlankEditorRow")')" class="allButtons" value='New Wound' />
- return PartialView("EditorTemplates/Wound", new PatientNewVisitModel.Wound());
Add Comment
Please, Sign In to add comment