-2

问题:我需要将下面的内部样式添加到 Telerik 报告中。请注意 a0 和 a1 是类。
样式表如下: 如何将其转换为 Telerik 报告接受的 XML 样式表。
请参阅:http
://www.telerik.com/help/reporting/style-understanding-style-selectors.html 但该链接没有详细说明如何将超链接选择器添加到 XML 样式表中。

下面的CSS:

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

1 回答 1

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");
  });
于 2012-09-02T02:16:40.823 回答