试图在弹出窗口中显示出现在主屏幕上的数据

时间:2017-02-10 05:35:44

标签: c# jquery asp.net-mvc bootstrap-modal

我正在尝试显示弹出的主屏幕中显示的数据,但不知道如何做到这一点。主屏幕上的数据绑定是通过数据库绑定 这是主屏幕上显示的数据 c#代码

<div class="col-md-12">
        <table class="table table-striped rht-table" cellpadding="0" cellspacing="0">
            <thead>
                <tr>
                    <td colspan="2"><h2><strong>@HttpContext.GetLocalResourceObject(_vpth, "TicketDetails", _owrpr.GlobalCultureInfo).ToString()</strong></h2></td>
                </tr>
                <tr class="bg-danger" style="background: #2d323e !important; border-radius: 10px;">

                    <th>@HttpContext.GetLocalResourceObject(_vpth, "CreatedBy", _owrpr.GlobalCultureInfo).ToString()</th>
                    <th>@HttpContext.GetLocalResourceObject(_vpth, "CreationDate", _owrpr.GlobalCultureInfo).ToString()</th>
                    <th>@HttpContext.GetLocalResourceObject(_vpth, "IssueType", _owrpr.GlobalCultureInfo).ToString()</th>
                    <th>@HttpContext.GetLocalResourceObject(_vpth, "AssignedTo", _owrpr.GlobalCultureInfo).ToString()</th>
                    <th>@HttpContext.GetLocalResourceObject(_vpth, "ClosedBy", _owrpr.GlobalCultureInfo).ToString()</th>
                    <th>@HttpContext.GetLocalResourceObject(_vpth, "ClosedDate", _owrpr.GlobalCultureInfo).ToString()</th>

                    <th>@HttpContext.GetLocalResourceObject(_vpth, "Description", _owrpr.GlobalCultureInfo).ToString()</th>
                    <th>@HttpContext.GetLocalResourceObject(_vpth, "Status", _owrpr.GlobalCultureInfo).ToString()</th>
                    <th style="padding:0px 10px;">
                        @HttpContext.GetLocalResourceObject(_vpth, "TimeRemaining", _owrpr.GlobalCultureInfo).ToString()
                        <p style="font-size:11px; margin-bottom: 5px;">HH:MM:SS</p>
                    </th>
                </tr>
                @foreach (var item in Model)
                {
                    <tr>
                        <td>@Html.DisplayFor(model => item.CreatedName)</td>
                        <td>@item.CreatedDate.ToString("dd-MMM-yyyy")</td>
                        @*<td>@Html.DisplayFor(model => item.IssueType)</td>*@
                        <td class="Esctyp"><a id="Esc_@item.EscId" class="crsr-pnt" data-toggle="modal" data-target="#EscModal">@item.IssueType</a></td>                        
                        <td>@Html.DisplayFor(model => item.AssignedPerson)</td>
                        <td>@Html.DisplayFor(model => item.ClosedBy)</td>
                        <td>
                            @if (item.ClosedDate.ToString("dd MMMM yyyy") != "01 January 0001")
                            {
                                @Html.Raw(item.ClosedDate.ToString("dd MMMM yyyy"))
                            }
                        </td>

                        <td>
                            @if (item.CreatorDescription.Length > 10)
                            {
                                @Html.Raw(item.CreatorDescription.Substring(0, 10) + "...")
                            }
                            else
                            {@Html.Raw(item.CreatorDescription) }
                        </td>
                        @*<td id="statusdiv_@item.EscId" class="statusdiv">@Html.ActionLink(@Html.DisplayFor(model => item.Status).ToString(), "Escalation")</td>*@                        
                        <td>@Html.DisplayFor(model => item.Status)</td>
                        <td>
                            <div id="clockdiv_@item.EscId" class="clockdiv" tat="@item.CreatedDate.AddHours(item.TAT)">
                                <div style="display:inline-flex;">
                                    <span class="hours"></span>:<span class="minutes"></span>:<span class="seconds"></span>
                                </div>
                            </div>
                        </td>
                    </tr>
                }
            </thead>
        </table>
    </div>

这是弹出式数据设计的外观,我的要求是用这个弹出式设计模板中的数据填充主屏幕上出现的相同值 c#代码

<div class="modal fade" id="EscModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">@Session["Name"].ToString() (@Session["ErpCode"].ToString()) - @Html.TextBox("AtDate")</h4>
            </div>
            <div class="modal-body">
                <div class="col-md-12">
                    <div class="col-md-6">
                        @HttpContext.GetLocalResourceObject(_vpth, "zone", _owrpr.GlobalCultureInfo).ToString()
                        <div class="clearfix"></div>
                       @Html.TextBox("zone")
                    </div>
                    <div class="col-md-6">
                        @HttpContext.GetLocalResourceObject(_vpth, "Department", _owrpr.GlobalCultureInfo).ToString()
                        <div class="clearfix"></div>
                        @Html.TextBox("Department")
                    </div>
                </div>
                <div class="col-md-12">
                    <div class="col-md-6">
                       @HttpContext.GetLocalResourceObject(_vpth, "CreatedBy", _owrpr.GlobalCultureInfo).ToString()
                        <div class="clearfix"></div>
                        @Html.TextBox("CreatedBy")
                    </div>
                    <div class="col-md-6">
                        @HttpContext.GetLocalResourceObject(_vpth, "CreationDate", _owrpr.GlobalCultureInfo).ToString()
                        <div class="clearfix"></div>
                        @Html.TextBox("Date")                       
                    </div>
                </div>                
                <div class="col-md-12">
                    <div class="col-md-6">
                        @HttpContext.GetLocalResourceObject(_vpth, "Priority", _owrpr.GlobalCultureInfo).ToString()
                        <div class="clearfix"></div>
                        @Html.DropDownList("ddlPriority", new List<SelectListItem>
                    {
                        new SelectListItem { Text = "High", Value = "High" },
                        new SelectListItem{ Text="Medium", Value = "Medium" },
                        new SelectListItem{ Text="Low", Value = "Low" },
                     }, new { @class = "form-control" })
                    </div>
                    <div class="col-md-6">
                       @HttpContext.GetLocalResourceObject(_vpth, "IssueType", _owrpr.GlobalCultureInfo).ToString()
                        <div class="clearfix"></div>
                        @Html.TextBox("IssueType")
                    </div>
                </div> 
                <div class="col-md-12">
                    <div class="col-md-6">
                       @HttpContext.GetLocalResourceObject(_vpth, "AssignedTo", _owrpr.GlobalCultureInfo).ToString()
                        <div class="clearfix"></div>
                        @Html.TextBox("AssignedTo")
                    </div>
                    <div class="col-md-6">
                        @HttpContext.GetLocalResourceObject(_vpth, "Forward", _owrpr.GlobalCultureInfo).ToString()
                        <div class="clearfix"></div>
                        @Html.DropDownList("ddlEmployee", new SelectList(ViewBag.Employee, "ErpCode", "Name", ViewData["Empl"]), "-- " +
             HttpContext.GetLocalResourceObject(_vpth, "Forward", _owrpr.GlobalCultureInfo).ToString() + " --", new { @class = "form-control" })
                    </div>                    
                </div> 
                <div class="col-md-12">
                    <div class="col-md-6">
                        @HttpContext.GetLocalResourceObject(_vpth, "Status", _owrpr.GlobalCultureInfo).ToString()
                        <div class="clearfix"></div>
                        @Html.DropDownList("ddlPriority", new List<SelectListItem>
                    {
                        new SelectListItem { Text = "Open", Value = "Open" },
                        new SelectListItem{ Text="Close", Value = "Close" },
                     }, new { @class = "form-control" })
                    </div>
                    <div class="col-md-6">
                        @HttpContext.GetLocalResourceObject(_vpth, "Remarks", _owrpr.GlobalCultureInfo)
                        <div class="clearfix"></div>
                        @Html.TextArea("txtDescription", "", new { @class = "form-control", rows = "3", placeholder = HttpContext.GetLocalResourceObject(_vpth, "Description", _owrpr.GlobalCultureInfo) })
                    </div>
                </div>  
                <div class="col-md-12">                   
                    <div class="col-md-6">
                        @HttpContext.GetLocalResourceObject(_vpth, "Attachment", _owrpr.GlobalCultureInfo).ToString()
                        <div class="clearfix"></div>
                       @Html.TextBox("Attachment","", new { @class = "form-control", type = "file" })
                    </div>
                </div>    
            </div>
            <div class="modal-footer">
                <button type="button" id="btnCncl" class="btn btn-default" data-dismiss="modal">@HttpContext.GetLocalResourceObject(_vpth, "Close", _owrpr.GlobalCultureInfo).ToString()</button>
                <button class="btn btn-primary" id="btnSave">@HttpContext.GetLocalResourceObject(_vpth, "Save", _owrpr.GlobalCultureInfo).ToString()</button>
            </div>
        </div>
    </div>
</div>

我试图通过像这样的jquery绑定弹出窗口中的数据但是有人可以建议如何做到这一点 Jquery的

$(".Esctyp").click(function () {
 $('#zone').val(_lval[0]).attr("readonly", "readonly");
        $('#Branch').val(_lval[1]).attr("readonly", "readonly");
        $('#CreatedBy').val(_lval[2]).attr("readonly", "readonly");
        $('#Date').val(_lval[3]).attr("readonly", "readonly");
        $('#ClosedBy').val(_lval[4]).attr("readonly", "readonly");
        $('#ClosedDate').val(_lval[5]).attr("readonly", "readonly");
        $('#ddlPriority').val(_lval[6]).attr("readonly", "readonly");
        $('#IssueType').val(_lval[7]).attr("readonly", "readonly");
        $('#AssignedTo').val(_lval[8]);
        $('#txtDescription').val(_lval[9]);
        $('#ddlPriority').val(_lval[10]);
        $('#IssueDescription').val(_lval[11]);
        $('#ddlEmployee').val(_lval[12]);
        $('#Attachment').val(_lval[13]);
    });

所有视觉描述都在给定图像enter image description here

0 个答案:

没有答案
相关问题