View unanswered posts | View active topics It is currently 2020-05-26 7:16



This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
 点击subnetwork时,显示内部的视图? 
Author Message
新手上路

Joined: 2014-04-17 13:34
Posts: 11
Post 点击subnetwork时,显示内部的视图?
如附件所示,想实现这样的效果:建一个树的根节点(dummy类型,名字叫我的项目),下面有子网sever1(subnetwork类型)。当鼠标点击根节点 我的项目时,拓扑图上显示 各子网的图标(就是跟附件差不多),当我点击server1时,应该显示子网内部的视图。现在点击server1时,不会进入子网内部视图。

总的来说2个问题: 1.点击我的项目节点时,network的过滤函数怎么写好点?(我的思路是 判断元素的parent是否当前选中的节点) 2.点击子网时,如何马上进入子网内部,现在好像没有这个函数。


Attachments:
无标题.png
无标题.png [ 148.84 KiB | Viewed 6799 times ]
2014-05-15 14:29
Profile
TWaver开发组
User avatar

Joined: 2009-04-20 18:37
Posts: 3115
Post Re: 点击subnetwork时,显示内部的视图?
默认在树上点谁,就进入点击网元所在的子网;比如点击server1就是进入server1所在的子网(也就是顶层子网,也就是默认子网null:network.CurrentSubNetwork = null;)
点击Rack1就进入Rack1所在的子网,也就是network.CurrentSubNetwork = server1;
您的需求和默认不一样,所以需要让树和拓扑图的选中模型分开:tree.ShareSelectionModel = false;
然后监听树的点击动作,设置network的当前子网。


2014-05-15 14:51
Profile
新手上路

Joined: 2014-04-17 13:34
Posts: 11
Post Re: 点击subnetwork时,显示内部的视图?
谢谢,上面的问题,已经解决了。还有个问题,需要请教下:

我锁定network后,双击子网就无法进入子网进行查看。
个人觉得这样不太合理,锁定后应该仍然有权限进入子网进行查看网元的功能,请问该如何实现或规避呢?

private void LockCommandExecute()
{
locked = !locked;
if (locked)
{
network.InteractionHandlers = null;
}
else
{
network.SetDefaultInteractionHandlers(false);
}

}


2014-05-15 20:08
Profile
新手上路

Joined: 2014-04-17 13:34
Posts: 11
Post Re: 点击subnetwork时,显示内部的视图?
已经自己解决了,虽然不明白函数名字的意思,但是通过network.SetPanInteractionHandlers(); 可以实现不能拖到网元,但是可以进入子网进行查看的功能。


2014-05-15 20:18
Profile
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron