请建议我使用简单的树视图结构在数据库表中添加用户的代码 [英] please suggest me the code for adding the users in database table by using simple tree view structure

查看:64
本文介绍了请建议我使用简单的树视图结构在数据库表中添加用户的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如。



1

/ \

2 3





当这个第一个用户添加它时是主节点

然后下一个用户是主节点的左子节点主节点的第三个用户右边的子节点就像这样......

解决方案



快速入门就是考虑这些场景步骤:

- 每个节点可以是一行表

- 每个节点都可以有一个唯一的整数名称用作参考

- 每个节点当然都有它的值

- 每个节点都会引用它的父节点

- 添加节点意味着在表格中添加一行

- 添加节点时,有必要通过填写其父编号(链接)来说明链接到哪个父级

- 需要定义节点上的操作,例如Add







希望这会指向正确的方向,

干杯,


查看我的过去的答案 [ ^ ]。

for eg.

1
/ \
2 3


in this when first user added it is the main node
then next second user be the left child node of main node and third user right child of the main node like this....

解决方案

Hi,
A quick start would be to consider these scenario steps:
- each node can be a row a table
- each node can hava a unique integer "name" to be used as reference
- each node has of course its value
- each node will refer to it's parent
- adding a node means adding a row in the table
- when adding a node it is necessary to say to which parent it is linked by filling out its parent number (link)
- operations on nodes need to be defined, for example Add

etc

Hope this will point you in the right direction,
Cheers,


Have a look at my past answer[^].


这篇关于请建议我使用简单的树视图结构在数据库表中添加用户的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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