Jquery 使用Knockout.js在模式弹出窗口中打开部分视图

Jquery 使用Knockout.js在模式弹出窗口中打开部分视图,jquery,asp.net-mvc-4,knockout.js,Jquery,Asp.net Mvc 4,Knockout.js,我已经用viewmodel usning knockout.js加载了部分视图资产列表 <td> <div class="left CursorP ellipsis" style="float: left;" data-bind="text: Name, attr: { 'title': Name },click:$root.eventHandlers.ViewDetail"></div> </td> <td da

我已经用viewmodel usning knockout.js加载了部分视图资产列表

 <td> 
    <div class="left CursorP ellipsis" style="float: left;" data-bind="text: 
     Name, attr: { 'title': Name },click:$root.eventHandlers.ViewDetail"></div>


</td>
<td data-bind="text: Description"></td>
<td data-bind="text: Source"></td>
<td data-bind="text: CapturedBy"></td>
<td data-bind="text: Status"></td>
<td data-bind="text: LastAccessedBy"></td>
链接[assetDetailPage]是安全的/Content/Catalog/Detail?assetId=+this.Id

与同一窗口[window.location]不同,我们如何使用上面的“内部视图详细信息”功能中的链接打开模式弹出窗口?

您可以使用iframe标记加载外部内容

<iframe width="300" height="300"
  data-bind="attr: { src: 'Secure/Content/Catalog/Detail?assetId=' + Id }"></iframe>

我不知道您的模型结构,您可能需要用Id或$parent.Id替换Id。

您可以使用jquery这样做

<iframe width="300" height="300" id="model"
    data-bind="
        attr: { src: $root.LoadModel(Id) }
"></iframe>


self.LoadModel = function(id){
    var location = 'Secure/Content/Catalog/Detail?assetId='+id
    $('#model').load(location)
    return location
}
我想用相同的Secure/Content/Catalog/Detail打开弹出窗口?assetId='+Id on Name link点击网格;不加载IFrame。
这可能会将Iframe中的部分页面添加到表的同一行/列中。当您单击表第一列中的名称链接时,我需要在模式弹出窗口中打开该页面。
<iframe width="300" height="300" id="model"
    data-bind="
        attr: { src: $root.LoadModel(Id) }
"></iframe>


self.LoadModel = function(id){
    var location = 'Secure/Content/Catalog/Detail?assetId='+id
    $('#model').load(location)
    return location
}