`
Supanccy2013
  • 浏览: 214375 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

easyui treegrid 添加复选框

阅读更多
$(function(){
    $('#test').treegrid({
        url:"data/treegrid_data.json",
        idField:'id',
        treeField:'name',
        animate:"true",
        rownumbers:"true",
        columns:[[
            {title:'Task Name',field:'name',formatter:function(value,rowData,rowIndex){
                return " " + rowData.name;
        },width:180},
            {field:'size',title:'Persons',width:60,align:'right'},
            {field:'date',title:'Begin Date',width:80}
        ]]
    });
    $("#consle").bind("click",consleclick)
});

function set_power_status(){
    var idList = "";
     $("input:checked").each(function(){
        var id = $(this).attr("id");
        if(id.indexOf("ceshi_")>-1)
            idList += id.replace("ceshi_",'')+',';
     })
    alert(idList);
}

function consleclick(){
    var node = $('#test').treegrid('expandAll',2);
}



一般会有个checkbox:true的列,删掉他就OK

如果是HTML结构就是<th data-options="field:'ck',checkbox:true"></th>
js结构就是:{field:'ck',title:'选择',checkbox:true},
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics