【发布时间】:2020-11-21 22:35:15
【问题描述】:
在我的 DataTable Jquery 上,我需要手动初始化(使用 JS / JQuery)data-plugin = "selectable" 插件。当我将它添加到 html 时,一切正常,但我需要使用 Jquery 手动初始化它。有谁知道如何帮助我?
谢谢你!
<div class="panel panel-default">
<table id="dtFinanceiroParcela" class="table table-striped table-bordered center-header table-vcenter table-responsive-lg" data-plugin="selectable" data-row-selectable="true" cellspacing="0" width="100%">
<thead class="bg-blue-grey-100">
<tr>
<th>
<span class="checkbox-custom checkbox-default">
<input class="selectable-all" type="checkbox">
<label></label>
</span>
</th>
<th>
Parcela
</th>
<th>
Data de Emissão
</th>
<th>
Data de Vencimento
</th>
<th>
Valor da Parcela
</th>
<th>
Situação
</th>
<th>
Ações
</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
我试着这样做,但没有成功:
$('#dtFinanceiroParcela').selectable();
【问题讨论】:
-
我可能误解了这个问题 - 但您是否在寻找
select: true选项?这假设您已经在页面中包含了所需的“选择”CSS 和 JS(来自here)。 -
或者,您是否正在寻找一种动态加载这些 CSS 和 JS 文件的方法?在这种情况下,this 之类的东西有帮助吗?
-
它不会引用 CSS 或 JS。这将是初始化插件,因为我使用的是 ASP.NET 核心 mvc,并且在我的表单中,我将 Layout 设置为 null。
-
好的 - 谢谢。在这种情况下,我不确定您所说的“初始化插件”是什么意思。也许这对 ASP.NET 用户来说意味着什么。也许您应该将该标签添加到您的问题中?
标签: javascript jquery asp.net-mvc datatables