Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

希望可以添加动态节点的支持 #8

Open
kkle1994 opened this issue Nov 8, 2022 · 5 comments
Open

希望可以添加动态节点的支持 #8

kkle1994 opened this issue Nov 8, 2022 · 5 comments

Comments

@kkle1994
Copy link

kkle1994 commented Nov 8, 2022

在很多场景里,节点一般都不是固定的,如果可以支持动态节点就更好了。
我自己也在尝试改STNodeTreeView相关的代码,但是因为工作时间比较紧张,不知道能不能做成泛用性好些的代码,只是一个小小的建议。感谢你的工作 : )

@kkle1994
Copy link
Author

kkle1994 commented Nov 8, 2022

我现在的做法是做了一个template类,每次node在OnCreate的时候,从template里读取,唯一的问题是需要在TreeView做一个新的Add,然后在view里面做一个Dictionary结构记录:Node类、Template实例,还在开发当中,不过我的template是为了项目特化的,但是可以稍微改下就能用。只会我会考虑fork一下开个新的branch分享一下(如果有时间的话)

@DebugST
Copy link
Owner

DebugST commented Nov 8, 2022

在很多场景里,节点一般都不是固定的,如果可以支持动态节点就更好了。 我自己也在尝试改STNodeTreeView相关的代码,但是因为工作时间比较紧张,不知道能不能做成泛用性好些的代码,只是一个小小的建议。感谢你的工作 : )

我有些不是很明白是什么意思。。动态更新?。。自带的TreeView是可以支持添加NodeType的啊。。所以我有点懵。。而且TreeView的结构 目前也是一个目录的结构只要给节点一个路径就可以了。

@kkle1994
Copy link
Author

kkle1994 commented Nov 8, 2022

我这边目前的需求是从Go语言里读到一些struct,之后在这个控件里作为node来显示,这个是动态的意思。大概就是要根据一个模板批量创建node的类型,他的Class不是固定的,而且需要在Tree里面分开显示,比如一个“Condition”的模板,会有几十个需要对应的Node的Class,而且要根据Golang里面的代码动态变化一些内容,之后分开显示到tree里面这样。

@bloxofcodes
Copy link

Hello I'm looking also on this solution of dynamic nodes, but from me the structure will come from .json file?
din you already implement the dynamic approach you want to do? @kkle1994

@kkle1994
Copy link
Author

Hello I'm looking also on this solution of dynamic nodes, but from me the structure will come from .json file? din you already implement the dynamic approach you want to do? @kkle1994

I've used another library to replace this, hope this can help you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants