我试图使用 Oracle JET 在 HTML 表中显示图像,我在支持的 JavaScript 文件中编写了这个:
var image = document.createElement("IMG"),
image.setAttribute("src", "../../../status_up.png");
self.listData.push({
Status: image
});
在 HTML 中,代码如下所示:
<table id="test_table"
data-bind="ojComponent: {component: 'ojTable',
data: datasource,
scrollPolicy: 'loadMoreOnScroll',
selectionMode: {row: 'single', column: 'single'},
columnsDefault: {sortable: 'enabled'},
columns: [{headerText: 'Status',
field: 'Status'}]
rootAttributes: {'style':'width: 100%; height: 230px;'}}">
表格显示正确,但它应该显示图像的列显示如下:
[object HTMLImageElement]
我看到图像 URL 的格式正确,当我转到图像 URL 时,我能够下载并看到图像。但它不会出现在 HTML 表中。我在这里错过了什么吗?