asp.net mvc - how to pass value to a modal? -
i have problem , own view contains form , form contains list , need items list " hidden " , show them modal , still not know how , i've been reading items seems no fits in case , detail : hidden item list appears form, use case: user selects list of order , order products has , display modal , structure of list follows: listorder [ ] listproduct , code . . :
entity:
namespace teste.models { public class order { public int64 order { get; set; } public string supply { get; set; } public list<product> listproduct { get; set;} } namespace teste.models { public class product { public int64 cod { get; set; } public string name { get; set; } }
view
@model test.models.order <head> <meta charset="utf-8" /> <title>teste</title> <meta name="viewport" content="width=device-width" /> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css"> <link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"> <link rel="stylesheet" href="http://cdn.datatables.net/1.10.2/css/jquery.datatables.min.css"> <script type="text/javascript" src="http://cdn.datatables.net/1.10.2/js/jquery.datatables.min.js"></script> <script type="text/javascript" src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> @styles.render("~/content/bootstrap.css") @scripts.render("~/bundles/modernizr") <style> th { height: 10px; } </style> <script> $(function () { $("#dialog").dialog({ modal: true, autoopen: false, }); $(".opener").click(function () { $("#dialog").dialog("open"); }); }); </script> </head> <body> <div id="divbody"> <nav class="navbar navbar-inverse"> </nav> @using (html.beginform("save", "cab", formmethod.post)) { <div class="table-responsive" id="table"> <table id="mytable" class="table table-striped" cellspacing="0"> <thead style="position:static"> <tr> <th style="font-size:10px">select</th> <th style="font-size:10px">contact</th> <th></th> <th style="font-size:10px">supply</th> <th style="font-size:10px">order</th> </tr> </thead> @for (int = 0; < model.listorder.count(); i++) { <tr> <td align="center" height="2px">@html.checkboxfor(m => m.listorder[i].isedit, new { @onclick = "habilit(" + + ")", @id = "c" + })</td> <td colspan="2"> <a href="@url.action("getfornecedor", "mycontroller")" class="btn btn-xs btn-primary"> <i class="glyphicon glyphicon-phone-alt"></i> </a> <a href="@url.action("sendemail", "mycontroller")" class="btn btn-xs btn-primary"> <i class="glyphicon glyphicon-envelope"></i> </a> </td> <td height="2px"> @html.textboxfor(m => m.listorder[i].supply, new { @readonly = "readonly", @size = "18px", @class = "form-controlsupply" }) </td> <td height="2px"> @html.textboxfor(m => m.listorder[i].order, new { @readonly = "readonly", @size = "75px", @class = "form-controlorder" }) </td> <td></td> </tr> } </table> </div> <br /> <input type="submit" value="salve" id="btn" disabled="disabled" class="btn btn-small btn-primary" /> } <div id="dialog" title="dados fornecedor"> <p>teste dados fornecedor</p> </div> </div> </body> </html>
Comments
Post a Comment