我正在尝试使用 dynatable 生成一个交互式表格。我遵循了文档说明,但我仍然在两列的所有值中得到“未定义”。我相信这data-dynatable-ignore="true"
是行不通的,我想知道正确的方法。
HTML:
<table id="example" cellspacing="0" width="100%" class="dynatable table table-condensed table-hover table-striped table-bordered">
<thead>
<tr>
<th rowspan="2" data-dynatable-column="Unidade">Unidade</th>
<th rowspan="2" data-dynatable-column="Meta">Meta</th>
<th colspan="2" data-dynatable-ignore="true">Inclusão</th>
<th colspan="2" data-dynatable-ignore="true">Confirmação</th>
</tr>
<tr>
<th data-dynatable-column="ValorI">Valor</th>
<th data-dynatable-column="%I">%</th>
<th data-dynatable-column="ValorC">Valor</th>
<th data-dynatable-column="%C">%</th>
</tr>
</thead>
</table>
JS:
$('#example').dynatable({
features: {
paginate: false,
sort: true,
pushState: false,
search: false,
recordCount: false,
perPageSelect: false
},
dataset: {
ajax: true,
ajaxUrl: 'https://api.myjson.com/bins/n4ecd',
ajaxOnLoad: true,
records: []
}
});