Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Knowing when a node is being deleted in javascript (Read 1696 times)
jcollins@scires
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 53
Joined: Feb 17th, 2009
Knowing when a node is being deleted in javascript
Mar 31st, 2009 at 7:17pm
Print Post  
Hello, I am currently using ImageMap mode for the diagram. Is there any way when you have delete key enabled to delete a node within javascript to know that the node is being deleted? For instance for the following code:
var prm = Sys.WebForms.PageRequestManager.getInstance();
       prm.add_initializeRequest(InitializeRequest);
       prm.add_endRequest(EndRequest);
      
       function InitializeRequest(sender, args) {
           if (prm.get_isInAsyncPostBack()) {
               args.set_cancel(true);
           }
       }

Is there any way to know inside of InitializeRequest that the node is attempting to be deleted? I just want to cancel the event if other controls such as text boxes are the active element.
Thanks,
Jay
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Knowing when a node is being deleted in javasc
Reply #1 - Apr 1st, 2009 at 1:59pm
Print Post  
Seems we'll have to implement some focus management to prevent the diagram from stealing the del keystrokes from other controls. We'll do that for the V.3.0.1 release; until then you could set DelKeyAction = None and handle the keydown event for Del yourself.

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Knowing when a node is being deleted in javasc
Reply #2 - Apr 9th, 2009 at 1:17pm
Print Post  
Hi Jay,

This version implements focus support for the diagram's DIV: https://mindfusion.eu/_beta/netdiag_301pre.zip

Now Del, Ctrl+C, etc. should work only when the focus is on the diagram.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint