本文介绍了单击复选框时 Bootgrid 选择行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
限时送ChatGPT账号..我使用 Bootgrid 在表格中显示数据:http://www.jquery-bootgrid/
I am using Bootgrid to display data in tables: http://www.jquery-bootgrid/
当我将 rowSelect
设置为 true
时,我选中复选框时无法选择该行:
When I set the rowSelect
to true
, I can't select the row when I check the checkbox:
我创建了一个 JSFiddle:https://jsfiddle/n2jqjtep/1/
I have created a JSFiddle: https://jsfiddle/n2jqjtep/1/
<table id="employeeList" class="table table-bordered">
<thead>
<tr>
<th data-column-id="iEmployeeId" data-type="numeric" data-visible="false" data-identifier="true">Id</th>
<th data-column-id="sName">Name</th>
<th data-column-id="sAddress">Address</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>dsa</td>
<td>asd</td>
</tr>
<tr>
<td>2</td>
<td>sss</td>
<td>assd</td>
</tr>
</tbody>
</table>
这是 JavaScript:
And this is the JavaScript:
var dt = $('#employeeList').bootgrid({
selection: true,
rowSelect: true,
converters: {},
});
我想在复选框被选中时选择行.
I want to select the Row when the checkbox is checked.
推荐答案
您必须使用:
var dt = $('#employeeList').bootgrid({
selection: true,
rowSelect: true,
converters: {},
}).on("selected.rs.jquery.bootgrid", function(e, rows) {
alert("Its Working");
}));
这里有几个例子:http://www.jquery-bootgrid/examples
这篇关于单击复选框时 Bootgrid 选择行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论