【发布时间】:2017-04-06 15:35:03
【问题描述】:
除了currentTasks 和workflowHistory 表之外,我还想再添加两个表。我在workflow-form.get.html.ftl 中添加了两个带有标题的块,在workflow-form.js 中添加了两个小部件。我还在.properties 文件中添加了标签映射。
问题是我的表格总是显示在页面底部并且没有标题:
我还注意到历史表(以及当前表)的块有一个 ID,类似于:
page_x002e_data-form_x002e_workflow-details_x0023_default-workflowHistory-form-section
我的表没有这样的 ID。它们被简单地放置在这样的容器中:
<div class="form-element-background-color yui-dt">
我的workflow-form.get.html.ftl的一部分:
...
<#-- I added this div for additional table -->
<div id="${el}-finishedBpAttachmentsDetails-form-section" class="workflow-attachments-details">
<h3>${msg("header.finishedBpAttachmentsDetails")}</h3>
<div class="form-element-background-color"></div>
</div>
<#-- And also this div -->
<div id="${el}-finishedBpDetails-form-section" class="workflow-details">
<h3>${msg("header.finishedBpDetails")}</h3>
<div class="form-element-background-color"></div>
</div>
<#-- Will be inserted below "Items" in the form after its been loaded through ajax -->
<div id="${el}-currentTasks-form-section" class="current-tasks">
<a name="current-tasks"></a>
<h3>${msg("header.currentTasks")}</h3>
<div class="form-element-background-color"></div>
</div>
<#-- Will be inserted in the bottom of the form after its been loaded through ajax -->
<div id="${el}-workflowHistory-form-section" class="workflow-history">
<h3>${msg("header.history")}</h3>
<div class="form-element-background-color"></div>
</div>
...
我的workflow-form.js的一部分:
...
var finishedBpDetailsDS = new YAHOO.util.DataSource(dsRes,
{
responseType: YAHOO.util.DataSource.TYPE_JSARRAY
});
var finishedBpDetailsContainerEl = Dom.get(this.id + "-finishedBpDetails-form-section"),
finishedBpDetailsTasksEl = Selector.query("div", finishedBpDetailsContainerEl, true);
var finishedBpDetailsColumnDefinitions = [
...
];
this.widgets.finishedBpDetailsTasksDataTable = new YAHOO.widget.DataTable(finishedBpDetailsTasksEl,
finishedBpDetailsColumnDefinitions, finishedBpDetailsDS,
{
MSG_EMPTY: this.msg("label.noTasks")
});
var finishedBpAttachmentsDetailsColumnDefinitions = [
...
];
var finishedBpAttachmentsDetailsDS = new YAHOO.util.DataSource(this.dsAttachmentRes,
{
responseType: YAHOO.util.DataSource.TYPE_JSARRAY
});
var finishedBpAttachmentsDetailsContainerEl = Dom.get(this.id + "-finishedBpAttachmentsDetails-form-section"),
finishedBpAttachmentsDetailsTasksEl = Selector.query("div", finishedBpAttachmentsDetailsContainerEl, true);
this.widgets.finishedBpAttachmentsDetailsTasksDataTable = new YAHOO.widget.DataTable(finishedBpAttachmentsDetailsTasksEl,
finishedBpAttachmentsDetailsColumnDefinitions, finishedBpAttachmentsDetailsDS,
{
MSG_EMPTY: this.msg("label.noTasks")
});
Selector.query(".form-fields", this.id, true).appendChild(finishedBpAttachmentsDetailsTasksEl);
Selector.query(".form-fields", this.id, true).appendChild(finishedBpDetailsTasksEl);
...
如何设置表格的位置和标题?..例如,我想在包含一般信息的块之后显示表格。
有可能吗?
【问题讨论】:
标签: javascript alfresco freemarker yui alfresco-share