树视图控制器 [英] Tree View controller

查看:74
本文介绍了树视图控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



我用分配和取消分配按钮开发了两个树控件

分配按钮将所选节点从tree1移动到tree2

unallocate按钮将所选节点从tree2移动到tree1





我正确完成了以上几点。

树1

Hi friends,

I developed two tree control with allocate and unallocate button
allocate button move selected nodes from tree1 to tree2
unallocate button move selected nodes from tree2 to tree1


I done the above points correctly.
Tree 1

- Page Content(Parent Node)
    Add Page
    List Pages
    Add Banner
    List Banners







我的问题是,首先我从Tree1的父节点(页面内容)中选择几个子节点(列表页面,列表横幅)并单击分配按钮,它们将正确分配到另一个树,如下所示:

树2




My problem is, first i select few child nodes(List Page,List Banner) from parent node(Page Content)of Tree1 and click allocate button,they will allocate to another tree correctly like below:
Tree 2

List Page
List Banner



如果我从同一父节点(页面内容)中选择剩余子节点(添加页面,添加横幅)并单击分配按钮意味着,它们将不会用当前选择替换现有节点。


而不是那个,它们看起来如下;

树2


if i select remaining child nodes(add page, add banner) from same parent node(Page Content) and click allocate button means, they will not replace the existing nodes with current selection.

instead of that, they look like follows;
Tree 2

List Page
List Banner
- Page Content
    Add Page
    List Page
    Add Banner
    List Banner





但我需要这个,如果我从同一个父选择中选择剩余的子节点,



我需要输出如下:





But I need that, if i select remaining child nodes from same parent means,

I need the output as follows:

- Page Content
    Add Page
    Add Banner
    List Page
    List Banner



请各位朋友帮我解决此问题


Please friends help me to solve this

推荐答案

删除分支的列表页面和列表横幅并将它们移动到另一个树后,它们现在是中继线。当你向后移动它们时,你正在移动两个树干,现在有3个树干,这种关系已经丢失。



你要做的事情通常是用清单完成的盒子里面没有任何关系的盒子。



你需要做更多的工作才能让你做你正在尝试的事情。一种方法是在一侧'隐藏'项目然后检查你何时未分配(如果它已经存在)并且取消隐藏它。



使用以这种方式树似乎是一个糟糕的选择(来回)。如果你想使用一棵树,那么你可以有一棵树,每个节点都有一个复选框,表示你可以打开和关闭的分配。
Once you've removed the branches 'List Page' and 'List Banner' and move them to the other Tree, they are now trunks. When you move them back you are moving two trunks back and now have 3 trunks, the relationship has been lost.

What you are trying to do is generally done with list boxes where there isn't any relationship between the items.

You will need to do a lot more work to get this to do what you are trying. One way would be to 'Hide' the items on one side and then check to see when you 'unallocate' if it already exists and 'unhide' it.

Using a tree in this manner seems to be a poor choice (back and forth). If you want to use a tree then you can have one tree and have check boxes at each node that indicate allocation that you can turn on and off.


这篇关于树视图控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆