2014-07-23 29 views
0

我有裝載視圖模型usning knockout.js開放式偏查看在模式彈出使用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> 

在.js文件我需要打開名稱鏈接

的點擊_AssetDetail局部視圖部分資產列表查看

this.ViewDetail =函數(){

 self.SelectedAssetTodelete.removeAll(); 
     self.SelectedAssetTodelete.push(this); 
     window.location = "#assetId=" + this.Id; --This is opening the Partial view correctly but in the same tab 
    }; 

的鏈路assetDetailPage]是安全/內容/目錄/詳情?由assetid =」 + this.Id

而不是相同的窗口[window.location],我們如何使用此ViewDetail函數中的鏈接打開Modal Popup?

回答

0

您可以使用iframe標記加載外部內容。

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

我不知道你的模型結構,您可能需要與Id()$parent.Id()更換Id

0

你可以做這樣的使用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 
} 
+0

這可能會在表格的同一行/列中添加Iframe中的部分頁面。當您單擊表格第一列中的名稱鏈接時,我需要在Modal Popup窗口中打開頁面。 – MSK

0
  • 我想打開具有相同安全/內容/目錄/詳細信息彈出由assetid =」 +標識的網格名稱的鏈接點擊?;不加載IFrame。