【问题标题】:dataTables search messed up by input from another formdataTables 搜索被另一个表单的输入搞砸了
【发布时间】:2011-02-08 09:37:43
【问题描述】:

你好,我有这样的表格

<form id="ricerca" enctype="application/x-www-form-urlencoded" method="post" action=""><table class="inserisci_modifica">
<tr class="visualizza_dati">

<td class="nome_campo"><label for="ragsoc_denominazione">Ragione sociale o denominazione</label></td>
<td class="valore_campo">
<input type="text" name="ragsoc_denominazione" id="ragsoc_denominazione" value="" tabindex="1" /></td>
<td class="nome_campo"><label for="piva">Partita IVA</label></td>
<td class="valore_campo">
<input type="text" name="piva" id="piva" value="" tabindex="9" /></td></tr>

然后我有一个我应用 dataTables 的 html 表

然后我有这个代码

$("#ricerca").submit(function(event) {
    event.preventDefault();
    oTable.fnClearTable();//Empty the entire table of current row information.
    oTable.fnDraw();
});

问题是当我在表单中输入内容时,好像它被自动提交为 dataTables 的搜索字段,然后我可以在 dataTables 搜索字段中看到相同的文本,我不明白为什么

【问题讨论】:

    标签: javascript datatables


    【解决方案1】:

    没关系,我发现了错误,我正在使用插件,并且在 dataTableExt.oApi.fnSetFilteringDelay 我不得不改变

    anControl = $( 'input', _that.fnSettings().aanFeatures.f );
    

    anControl = $( 'table.dataTables input', _that.fnSettings().aanFeatures.f );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-05
      • 1970-01-01
      • 2012-12-07
      • 1970-01-01
      • 2021-08-10
      • 2023-03-04
      • 2013-08-27
      • 2013-06-16
      相关资源
      最近更新 更多