Datatables TYPO3流体与引导数据表的组合
我正在尝试将流体表单与引导数据表相结合。如果我用这种液体的形式,一切都很好。我在计算操作中得到“selectedProdukts”参数Datatables TYPO3流体与引导数据表的组合,datatables,typo3,fluid,Datatables,Typo3,Fluid,我正在尝试将流体表单与引导数据表相结合。如果我用这种液体的形式,一切都很好。我在计算操作中得到“selectedProdukts”参数 <f:section name="main"> <f:flashMessages /> <f:form action="calculate"> <div class="container"> <table id="tbl_helios_products" class="display" cellspac
<f:section name="main">
<f:flashMessages />
<f:form action="calculate">
<div class="container">
<table id="tbl_helios_products" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th></th>
<th><f:translate key="tx_heliostcotool_domain_model_produkt.bezeichnung" /></th>
<th><f:translate key="tx_heliostcotool_domain_model_produkt.hersteller" /></th>
<th><f:translate key="tx_heliostcotool_domain_model_produkt.warengruppe" /></th>
<th><f:translate key="tx_heliostcotool_domain_model_produkt.preis" /></th>
<th></th>
</tr>
</thead>
<tbody>
<f:for each="{produkts}" as="produkt">
<tr>
<td><f:form.checkbox name="selectedProdukts" property="selectedProdukts" value="{produkt.uid}" multiple="1"/></td>
<td>{produkt.bezeichnung}</td>
<td>{produkt.hersteller}</td>
<td>{produkt.warengruppe}</td>
<td>{produkt.preis}</td>
<td>edit/delete</td>
</tr>
</f:for>
</tbody>
</table>
<f:form.submit value="Vergleichen" />
</div>
</f:form>
</f:section>
以下是流体表单的HTML结果:
<table id="tbl_helios_products" class="display dataTable no-footer" width="100%" cellspacing="0" role="grid" aria-describedby="tbl_helios_products_info" style="width: 100%;">
<thead>
<tr role="row">
<th class="sorting_disabled" rowspan="1" colspan="1" style="width: 36px;" aria-label=""></th>
<th class="sorting_asc" tabindex="0" aria-controls="tbl_helios_products" rowspan="1" colspan="1" style="width: 217px;" aria-sort="ascending" aria-label="Bezeichnung: aktivieren, um Spalte absteigend zu sortieren">Bezeichnung</th>
<th class="sorting" tabindex="0" aria-controls="tbl_helios_products" rowspan="1" colspan="1" style="width: 177px;" aria-label="Hersteller: aktivieren, um Spalte aufsteigend zu sortieren">Hersteller</th>
<th class="sorting" tabindex="0" aria-controls="tbl_helios_products" rowspan="1" colspan="1" style="width: 238px;" aria-label="Warengruppe: aktivieren, um Spalte aufsteigend zu sortieren">Warengruppe</th>
<th class="sorting" tabindex="0" aria-controls="tbl_helios_products" rowspan="1" colspan="1" style="width: 108px;" aria-label="Preis: aktivieren, um Spalte aufsteigend zu sortieren">Preis</th>
<th class="sorting_disabled" rowspan="1" colspan="1" style="width: 151px;" aria-label=""></th>
</tr>
</thead>
<tbody>
<tr class="odd" role="row">
<td>
<td class="sorting_1">Cleany</td>
<td>Samsung</td>
<td>Waschmaschinen</td>
<td>4000</td>
<td>edit/delete</td>
</tr>
</tbody>
</table>
名称
赫斯特勒
瓦伦鲁佩
普赖斯
干净的
三星
瓦希马奇宁
4000
编辑/删除
有什么想法吗?数据表单独起作用,流体单独起作用,但将它们结合起来会产生奇怪的结果…我认为问题在于排序顺序搜索。如果我没有对表进行任何排序,那么它也可以工作。 但是,当我单击一个表头对数据进行排序,然后发送表单时,结果中的数据是错误的。我认为这是因为数据表操纵DOM,但我不确定 我现在的解决方案是:我不再使用复选框的flexform数据。我创建了一个小javascript,它将所选dara的每个ID放入流体表单的隐藏表单字段中。这是发送给控制器的,我可以处理
这与其说是一个解决方案,不如说是一个变通办法,但我对此感到满意;) 引导的常见问题是javascript的计时。要么HTML-DOM还没有准备好,要么库还没有加载,另一个JS也可以停止JS的执行,因为它在JS执行之前失败了。第二:检查服务器输出(而不是浏览器构建的DOM)是否与预期相同。第三种可能性是另一个JS,它在DataTable JS启动之前修改您的表,并且DataTable JS无法处理生成的表。
<table id="tbl_helios_products" class="display dataTable no-footer" width="100%" cellspacing="0" role="grid" aria-describedby="tbl_helios_products_info" style="width: 100%;">
<thead>
<tr role="row">
<th class="sorting_disabled" rowspan="1" colspan="1" style="width: 36px;" aria-label=""></th>
<th class="sorting_asc" tabindex="0" aria-controls="tbl_helios_products" rowspan="1" colspan="1" style="width: 217px;" aria-sort="ascending" aria-label="Bezeichnung: aktivieren, um Spalte absteigend zu sortieren">Bezeichnung</th>
<th class="sorting" tabindex="0" aria-controls="tbl_helios_products" rowspan="1" colspan="1" style="width: 177px;" aria-label="Hersteller: aktivieren, um Spalte aufsteigend zu sortieren">Hersteller</th>
<th class="sorting" tabindex="0" aria-controls="tbl_helios_products" rowspan="1" colspan="1" style="width: 238px;" aria-label="Warengruppe: aktivieren, um Spalte aufsteigend zu sortieren">Warengruppe</th>
<th class="sorting" tabindex="0" aria-controls="tbl_helios_products" rowspan="1" colspan="1" style="width: 108px;" aria-label="Preis: aktivieren, um Spalte aufsteigend zu sortieren">Preis</th>
<th class="sorting_disabled" rowspan="1" colspan="1" style="width: 151px;" aria-label=""></th>
</tr>
</thead>
<tbody>
<tr class="odd" role="row">
<td>
<td class="sorting_1">Cleany</td>
<td>Samsung</td>
<td>Waschmaschinen</td>
<td>4000</td>
<td>edit/delete</td>
</tr>
</tbody>
</table>