Guest User

Untitled

a guest
Jan 21st, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. <div id="editorRows">
  2. <div id="tabs">
  3. <ul>
  4. @foreach (var item in Model.woundList)
  5. {
  6. <li><a href="#@item.ID">@item.tabName</a></li>
  7. }
  8. </ul>
  9.  
  10. @for (int i = 0; i < Model.woundList.Count(); i++)
  11. {
  12. count= i;
  13. <div id="@Model.woundList[i].ID" >
  14. @Html.EditorFor(model => model.woundList[i])
  15. </div>
  16. }
  17. <input type="hidden" id="hdnIndex" value="@count.ToString()" />
  18. </div>
  19. </div>
  20.  
  21. function addTab(title, uri) {
  22. debugger;
  23. var tabTitle = title;
  24. var count;
  25. if (document.getElementById("hdnIndex") != null
  26. && document.getElementById("hdnIndex") != undefined) {
  27. count = parseInt(document.getElementById("hdnIndex").value);
  28. count = count + 1;
  29. tabTitle = tabTitle + "-" + count;
  30. document.getElementById("hdnIndex").value = count;
  31. }
  32. var newTab = $("#tabs").tabs("add", uri, tabTitle);
  33. }
  34.  
  35. <input id="btnAddTab" type="button" onclick="addTab('New Wound','@Url.Action("BlankEditorRow")')" class="allButtons" value='New Wound' />
  36.  
  37. return PartialView("EditorTemplates/Wound", new PatientNewVisitModel.Wound());
Add Comment
Please, Sign In to add comment