2012-09-01 83 views
-2

問題: 我需要將以下內部樣式添加到Telerik報告中。請注意a0和a1是課程。
樣式表如下:如何將其轉換爲telerik報表接受的XML樣式表。
參考:http://www.telerik.com/help/reporting/style-understanding-style-selectors.html
但該鏈接並沒有給你詳細說明如何將超鏈接選擇器添加到XML樣式表。下面將超鏈接樣式添加到Telerik報告

CSS:

a.a0:hover { 
     text-decoration: underline; 
} 
a.a1:link { 
text-decoration: underline; 
} 

回答

1
Below is how I worked around the above issue: 
ReportViewer.prototype.OnReportLoadedOld = ReportViewer.OnReportLoaded; 
       ReportViewer.prototype.OnReportLoaded = function() { 
        this.OnReportLoadedOld(); 

var reportFrame = document.getElementById(this.reportFrameID); 
        var reportDocument = reportFrame.contentWindow.document; 
        var body = reportDocument.getElementsByTagName("body")[0]; 

$(".a1", body).css("text-decoration", "underline"); 
$(".a0", body).css("text-decoration", "underline"); 

You can achive the hover like this: 

$(".a1", body).hover(function() { 
     $(".a1", body).css("text-decoration", "underline"); 
     }, function() { 
     $(".a1", body).css("text-decoration", "underline"); 
    }); 
+0

它救了我的一天。 – Amir