为什么在表头构造器中有groupBy的情况下,直到单击标题,Grouping才激活

时间:2019-07-15 21:59:24

标签: tabulator

在我真正单击标题区域之前,groupBy表参数不会以分组布局呈现我的表。我希望我的表呈现为根据"category_id"字段分组的表。我已指定groupBy:"category_id"

我尝试了Tabulator附带的所有各种CSS,以为可能与CSS有关。我还尝试了更新到最新版本(4.2.7)。我尝试在tableBuilt上调用'table.redraw();'

代码从此处开始。请注意,groupBy参数被列为category_id。如果不包含此行,则不会分组。

table = new Tabulator("#example-table", {
clipboard: true,
clipboardPasteAction: "replace",
columnCalcs: "both",
columns: columnsDefault,
data: tableData,
groupBy: "category_id",
groupClosedShowCalcs: true,
groupToggleElement: "header",
index: "row_index",
height: "100%",
history: true,
layout: "fitColumns",
movableColumns: true,
movableRows: true,
pagination: "local",
paginationSize: 200,
paginationSizeSelector: [5, 10, 15, 20, 25, 50, 100],
reactiveData: true,
responsiveLayout: "hide",
selectable: false,
tableBuilt: tableComplete,
width: "500px",
}

该表将呈现,但不显示分组。使用开发人员工具不会在控制台中显示任何错误。

1 个答案:

答案 0 :(得分:0)

我相信我可能已经找到了问题。我正在从REST服务器调用数据以构建用作数据源的tableData。我转而使用内置的制表器AJAX函数,现在可以使用了。

必须将tableData异步传送到Tabulator的时间已到。

我想我可以使用tableBuilt参数上的redraw()方法重绘表。

相关问题