tiankangyan 2013-04-28 10:55
浏览 537
已采纳

easy-ui data-options 怎样初始化checkbox为已选?

代码如上所示,我想让checkbox初始化就为全部选中,不知道应该怎么做?
谢谢

  • 写回答

3条回答 默认 最新

  • zyn010101 2013-04-28 15:03
    关注

    [code="java"]
    <!DOCTYPE html>



    CheckBox Selection on DataGrid - jQuery EasyUI Demo





    <br> function selectAllBox(){<br> $(&#39;#dg&#39;).datagrid(&#39;selectAll&#39;);<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]

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 为什么eprime输出的数据会有缺失?
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题