easy ui combotree 怎么带上checkbox 通过下边的方式,我可以加载combotree,但是不能让每个节点前,有checkbox请问该怎么做?<input id="deptUserId" name="deptUserId" type="text" /> <script type="text/javascript"> $('#deptUserId').combotree({ url: '/Common/TreeDeptUser', lines: true, checkbox: true }); </script> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 现在设置好了,可以带checkbox <script type="text/javascript"> $('#deptUserId').combotree({ url: '/Common/TreeDeptUser', lines: true, multiple: true }); </script>--------------新的问题:我希望只有部分节点,带有checkbox,请问该怎么做? 查了一下1.2.6版本没此功能,而且它不是真的input type='checkbox'只是一张图片而已 是的,当它选中一个checkbox,会自动增加一个 input hidden 来存储被选中的 value 我用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>} 登录的中javascript的问题 在线等...复杂JSON数据处理问题 求助!Ext4.0中treegrid如何获得和处理Servlet传来的Json数据 extjs TabPanel 中打开tab1和tab2出现混乱 求助 吐血封装TEXTAREA相关光标操作方法。。 关于JQUERY的问题,在线等给分。 如何把随机数当作变量 联动菜单的值保存问题 select 对象中 (可以多重选择的multiple) 前端导入数据问题 请教,javascript中如何删除表格中的所有行? 求教:是否在跨域情况下,$.ajax中的async=false是否会失效?
$('#deptUserId').combotree({
url: '/Common/TreeDeptUser',
lines: true,
multiple: true
});
</script>
--------------新的问题:我希望只有部分节点,带有checkbox,请问该怎么做?
是的,当它选中一个checkbox,会自动增加一个 input hidden 来存储被选中的 value
我用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>
}