- 注册时间
- 2016-10-14
- 最后登录
- 2023-6-6
- 阅读权限
- 10
- 积分
- 762
- 精华
- 0
- 帖子
- 185
|
本帖最后由 wise 于 2017-1-23 11:10 编辑
dforce 发表于 2017-1-23 11:03
请提供数据,html+js代码重现出你说的问题
json:
- {"status":"success","result":[{"resource_dictionary_id":159,"resource_dictionary_key":"authentication
- .object_type.self","resource_dictionary_name":"访问者(自己)","resource_dictionary_status":1,"resource_dictionary_root_id"
- :155,"isLeaf":1,"checked":"true"},{"resource_dictionary_id":158,"resource_dictionary_key":"authentication
- .object_type.user_role","resource_dictionary_name":"用户角色","resource_dictionary_status":1,"resource_dictionary_root_id"
- :155,"isLeaf":1,"checked":"false"},{"resource_dictionary_id":157,"resource_dictionary_key":"authentication
- .object_type.user_group","resource_dictionary_name":"用户组","resource_dictionary_status":1,"resource_dictionary_root_id"
- :155,"isLeaf":1,"checked":"false"},{"resource_dictionary_id":156,"resource_dictionary_key":"authentication
- .object_type.user_acount","resource_dictionary_name":"用户账户","resource_dictionary_status":1,"resource_dictionary_root_id"
- :155,"isLeaf":1,"checked":"false"}]}
复制代码
树代码:
- <ul id="authentication_object_type_tree" class="mini-tree" url="mmmm.jsp" dataField="result" valueField="resource_dictionary_id" parentField="resource_dictionary_root_id" textField="resource_dictionary_name" showTreeIcon="true" resultAsTree="false" showRadioButton="true" showFolderCheckBox="false" expandOnLoad="true" onNodeSelect="onLeftAuthenticationTypeTreeClick" onDrawNode="onLeftAuthenticationTypeTreeDraw"></ul>
复制代码
js代码:
- function onLeftAuthenticationTypeTreeDraw(e){
- //console.log(e);
- var tree = e.sender;
- var node = e.node;
- if(node.checked){//调试提示 systemCore.tips('i','选中'+node.resource_dictionary_id);//设置选中
- tree.selectNode(node.resource_dictionary_id.toString());
- //tree.selectNode("159");
- }
- //阻止选择父节点
- if (tree.hasChildren(node)) {
- e.cancel = true;
- }
- }
复制代码 默认已经设置上了,因为浏览器直接提示设置默认值成功,,但是样式就是不会变。。单选选中的时候tree样式应该是有个绿色的点。。
|
|