单击复选框时 Bootgrid 选择行

编程入门 行业动态 更新时间:2024-10-28 20:26:01
本文介绍了单击复选框时 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:关键词]

本文发布于:2023-04-23 08:21:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1038508.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:单击   复选框   Bootgrid

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!