日期:2014-05-16  浏览次数:20343 次

easyui中treegrid复选框不能复选的问题


点击复选框时只能单选,不知道什么问题,求大侠们指教

源码

//设置treegrid自适应
$(window).resize(function(){
    $('#treeGrid').treegrid('resize', {
        width: '100%'
    })
});

//js获取项目根路径,如: http://localhost:8088/jquery
function getRootPath(){
    //获取当前网址,如: http://localhost:8088/jquery/easyui/login.jsp
    var curWwwPath = window.document.location.href;
    //获取主机地址之后的目录,如: jquery/easyui/login.jsp
    var pathName = window.document.location.pathname;
    var pos = curWwwPath.indexOf(pathName);
    //获取主机地址,如: http://localhost:8088
    var localhostPaht = curWwwPath.substring(0, pos);
    //获取带"/"的项目名,如:/jquery
    var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
    return (localhostPaht + projectName);
}

var treeGrid;
$(function(){
    InitTreeGrid();
});

/**
 * 初始化treegrid
 */
function InitTreeGrid(){

    treeGrid = $('#treeGrid').treegrid({
        url: getRootPath() + '/treeGrid',
        title: '编辑treeGrid',
        rownumbers: true,
        idField: 'id',
        treeField: 'text',
        width: '100%',
        fitColumns: true,
        columns: [[{
            title: '序号',
            field: 'id',
align: 'center',
//复选框
            checkbox: true
        }, {
            title: '名称',
            field: 'text',
            width: 280
        }, {
            title: '全名',
            field: 'fullname',
            width: 280,
            align: 'right'
        }, {
            title: '英文名',
            field: 'nameen',
            width: 280
        }, {
            title: '级别',