通过下边的方式,我可以加载combotree,但是不能让每个节点前,有checkbox请问该怎么做?<input id="deptUserId" name="deptUserId" type="text" />        <script type="text/javascript">
            $('#deptUserId').combotree({
                url: '/Common/TreeDeptUser',
                lines: true,
                checkbox: true
            });
        </script>

解决方案 »

  1.   

    现在设置好了,可以带checkbox        <script type="text/javascript">
                $('#deptUserId').combotree({
                    url: '/Common/TreeDeptUser',
                    lines: true,
                    multiple: true
                });
            </script>
    --------------新的问题:我希望只有部分节点,带有checkbox,请问该怎么做?
      

  2.   

    查了一下1.2.6版本没此功能,而且它不是真的input type='checkbox'只是一张图片而已
      

  3.   


    是的,当它选中一个checkbox,会自动增加一个 input hidden 来存储被选中的 value
      

  4.   


    我用jstree带上checkbox,直接在html中加input check。  但是这个控件没有 combobox从其他地方抄的,然后稍微改了一下@model List<Ztree>
    <div style="height:5px">
    <div id="divjstree" style="float:left">
        @Html.Partial("P_JsTreeNode",Model)
    </div></div><script type="text/javascript">
        $(function () {
            $("#divjstree").jstree({
                "core": { "initially_open": ["jstreenode"] },
                "themes": {
                    "theme": "classic",
                    "dots": true,
                    "icons": true
                },
                plugins: ["themes", "html_data"]
            });
                });
    </script>@model List<Ztree>
    @{
        int JsTreeType = (int)ViewData[Constants.viewD_JsTreeType];       //在加载树时,加载不同类型
        string inputName = Constants.inputName_JsTree;
    }
    @foreach (var child in Model)

        <ul>
            @if (child != null)
            {
                string strCheck = child.isChecked ? "checked=\"checked\"" : "";     //CheckBox是否选中
                <li id="jstreenode">
                    @if (JsTreeType == Constants.JsTree_AllChks)
                    {
                        //用在-用户设置的地方
                        <input type="checkbox" name="@inputName" value="@child.id"  @strCheck />
                    }
                    @if (child.isChecked && JsTreeType == Constants.JsTree_PartChks)
                    {
                        //用在-task设置
                        <input type="checkbox" name="@inputName" value="@child.id"   />
                    }
                    <a href="#" class="usr">@child.name</a>
                    @if (child.children != null)
                    {         
                        @Html.Partial("P_JsTreeNode", child.children)           
                    }
                </li>
            }
        </ul>
    }