Advertisement
Guest User

Untitled

a guest
Feb 10th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 2.51 KB | None | 0 0
  1. @model IEnumerable<TracRite.Optimum.Enterprise.MVC.Models.RecipeImportConfigViewModel>
  2.  
  3. @{ ViewBag.Title = "Recipe Import Config"; }
  4.  
  5. <hr />
  6.  
  7. <h2>@ViewBag.Title</h2>
  8. <br />
  9.  
  10. @using (Html.BeginForm())
  11. {
  12.     @Html.AntiForgeryToken()
  13.     <h4>@ViewBag.Title</h4>
  14.  
  15.     <hr />
  16.  
  17.     <div class="form-horizontal col-md-offset-1">
  18.         @Html.ValidationSummary(true, "", new { @class = "text-danger" })
  19.  
  20.         <div class="form-group">
  21.             @*@Html.DropDownList("ClassName", new SelectList(Model))*@
  22.  
  23.             @*@Html.DropDownListFor(m => m, new SelectList(Model, "ClassName"),
  24.                         new { @class = "form-Control", id = "configList", name = "configList", value = "teste" })*@
  25.  
  26.             <select class="form-control">
  27.                 <option value="Model" disabled selected>Select...</option>
  28.                 @Url.Action("PartialRecipeImportConfig", "RecipeImportConfigController")
  29.                 @foreach (var item in Model) {
  30.                     <option value="@item.ConfigList">@item.ClassName </option>
  31.                 }
  32.             </select>
  33.  
  34.         </div>
  35.  
  36.         <hr />
  37.  
  38.         <div id="Properties" class="form-group">
  39.             @*@Html.Partial("_Properties", Model)*@
  40.         </div>
  41.  
  42.         <div class="form-group">
  43.             <input type="submit" value="Save" class="btn btn-default col-md-offset-2 col-md-1" />
  44.             @*@Html.ActionLink("Back to List", "Index", "AccessLevel", new { @class = "btn btn-default col-md-offset-1" })*@
  45.         </div>
  46.     </div>
  47. }
  48.  
  49. <script>
  50.     //function toggle(source, className) {
  51.     //    checkboxes = document.getElementsByClassName(className);
  52.     //    for (var i = 0, n = checkboxes.length; i < n; i++) {
  53.     //        checkboxes[i].checked = source.checked;
  54.     //    }
  55.     //}
  56.  
  57.     //function toggleAllPages(source) {
  58.     //    checkboxes = document.getElementsByName("Pages");
  59.     //    for (var i = 0, n = checkboxes.length; i < n; i++) {
  60.     //        checkboxes[i].checked = source.checked;
  61.     //    }
  62.     //}
  63.  
  64.     $(document).ready (function() {
  65.         $('#configList').on('change', function () {
  66.             selectedClass = $('#configList').val();
  67.             $.get(
  68.                 "../PartialRecipeImportConfig",
  69.                 { model: selectedClass} ,
  70.                 function( data ) {
  71.                     $("#Properties").html(data);
  72.                 }
  73.             ).fail(function(jqXHR) {
  74.                 $("#Properties").html(JSON.stringify(jqXHR));
  75.             });
  76.         })
  77.     });
  78. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement