代码如上所示,我想让checkbox初始化就为全部选中,不知道应该怎么做?
谢谢
![](https://profile-avatar.csdnimg.cn/d4a6aa210ca242bb8f96af9586240e8f_tiankangyan.jpg!4)
easy-ui data-options 怎样初始化checkbox为已选?
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
3条回答 默认 最新
- zyn010101 2013-04-28 15:03关注
[code="java"]
<!DOCTYPE html>
CheckBox Selection on DataGrid - jQuery EasyUI Demo
<br> function selectAllBox(){<br> $('#dg').datagrid('selectAll');<br><br> }</p> <p>CheckBox Selection on DataGrid
Click the checkbox on header to select or unselect all selections.
<table id="dg" class="easyui-datagrid" title="CheckBox Selection on DataGrid" style="width:700px;height:250px" data-options="rownumbers:true,url:'../datagrid/datagrid_data1.json',onLoadSuccess:selectAllBox"> <thead> <tr> <th data-options="field:'ck',checkbox:true"></th> <th data-options="field:'itemid',width:80">Item ID</th> <th data-options="field:'productid',width:100">Product</th> <th data-options="field:'listprice',width:80,align:'right'">List Price</th> <th data-options="field:'unitcost',width:80,align:'right'">Unit Cost</th> <th data-options="field:'attr1',width:220">Attribute</th> <th data-options="field:'status',width:60,align:'center'">Status</th> </tr> </thead> </table>
[/code]
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 metadata提取的PDF元数据,如何转换为一个Excel
- ¥15 关于arduino编程toCharArray()函数的使用
- ¥100 vc++混合CEF采用CLR方式编译报错
- ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
- ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
- ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
- ¥50 如何openEuler 22.03上安装配置drbd
- ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
- ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
- ¥15 Windows11, backspace, enter, space键失灵