2013-03-16 74 views
1

我用柱形圖(Highcharts),在我的意甲,事件點擊我有這樣的:Highcharts,highslide和的ReportViewer

var name = this.category; 
var url='../Graphics/VtnPopup.aspx?cat='+name; 
$.get(url, function (data) { 
hs.htmlExpand(null, { 
pageOrigin: { 
x: 50, 
y: 50 
}, 
headingText: name, 
maincontentText: data 
}); 

但VtnPopup我有一個的ReportViewer,所以當highslide開放我無法看到報告,我認爲它可能是「maincontentText」類型,你有任何想法做這樣的事情嗎?

回答

1

如果您想在彈出窗口中打開特定的URL,則不能使用Highslide maincontent方法。您必須使用Highslide iframe彈出框 - objectType: 'iframe',並結合src變量。
使用此在plotOptions

series: { 
    cursor: 'pointer', 
    point: { 
     events: { 
      click: function() { 
       var name = this.category; 
       var url = '../Graphics/VtnPopup.aspx?cat=' + name; 
       hs.htmlExpand(null, { 
        pageOrigin: { 
         x: 50, // this.pageX, will open the popup on top of each column 
         y: 50 // this.pageY will open the popup on top of each column 
        }, 
        objectType: 'iframe', 
        src: url, 
        headingText: name 
       }); 
      } 
     } 
    } 
} 
+0

喔我看,很好,可以完美運行。謝謝,你做了我的一天:D。還有一個問題,我如何將寬度和高度更改爲100%以覆蓋所有屏幕? – Lorenzo 2013-03-19 15:54:41

+0

對不起 - 我之前沒有看到您的後續問題。請參閱Highslide演示頁面瞭解如何創建全寬/高iframe彈出窗口:http://www.roadrash.no/hs-support/full-size-popup.html – RoadRash 2013-04-08 14:38:21

+0

謝謝,我用過: var sW = $ (窗口).WIDTH() - 50; var sH = $(window).height() - 50; 並設置寬度和高度。 – Lorenzo 2013-04-08 14:56:43