我必须动态添加一行到jquery数据表。问题是,我有几个单元具有data-sort
属性。我如何将这些属性添加到添加的行中?jQuery Datatables添加具有数据排序属性的行
<table>
<thead>
<tr>
<th>Name</th>
<th>Preis</th>
</tr>
</thead>
<tbody>
<tr>
<td data-sort="Max Müller">M. Müller</td>
<td data-sort="500">5,00 €</td>
</tr>
</tbody>
</table>
table.row.add([
'J. Wayne', // Here I need a data-sort="John Wayne"
'6,00 €', // Here I need a data-sort="600"
]).draw();
** [this](http://stackoverflow.com/questions/14286528/data table-dynamic-add-row-with-fnadddata-or-similar-and-add-a-class-to-a-sp)**可能会有帮助。 – mmushtaq