在加载过程结束后,我试图自动将表添加到报表中。我尝试在报表(context.$ report )上使用jQuery .append()方法:
function consumeEvent( context, event ) {
if (event.name == 'ic3-report-after-build') {
context.$report.append( "<table>...</table>" );
}
}
不幸的是什么都没发生。我做错了什么?
发布于 2016-07-19 00:00:06
您有正确的代码,但它仍然应该得到一些增强。
试试这个:
Report JavaScript
function consumeEvent( context, event ) {
if (event.name == 'ic3-report-after-build') {
context.$report.find('table#custom').remove()
context.$report.find('.ic3-report-content-container')
.append('<table id="custom"><tr><td>Table</td></tr></table>')
}
}
Report CSS
table#custom {
border: 1px solid #black;
position: absolute;
top: 0;
}
https://stackoverflow.com/questions/38445353
复制