[Users] adding a confirm popup

brad brad at numaps.com.au
Fri Jul 29 07:34:29 CEST 2011


List,

 

I have a Ext.tree.treepanel that works just fine. 

 

The new behaviour I'm trying to achieve. When the user selects a specific
leaf node only (I know that layer) by checking the box, I do not want to
proceed with the rendering of the layer. I must first popup a confirmation
form that tells the user something and then the user is expected to click
the 'YES' confirmation button and then the layer will be displayed on the
map as normal. If the user just closes down this popup form or selects the
'NO' confirmation the layer will not be displayed and the checkbox will be
unchecked.

 

I have placed a listener on the tree leaf which is fired on a 'checkchange'
and does allow me to launch the popup to the screen but for some reason when
the user selects the YES button it just displays the form again. Its like it
is stuck in some recursive mode.

 

The listener code is as follows so can anyone tell me what I could be doing
wrong here?

 

1)      I attach the listener as follows:

 

listeners: {   "checkchange": function(node){  processUserLayers(node);}
}

 

2)      This function triggers just file

 

function processUserLayers(node)

{

node.layer.setVisibility(false);                   

                                if(confMsg == null)

                                {

                                                confMsg = Ext.Msg.show

                                                ({

 
title:'Warning!',

                                                                msg: 'This
should not replace Dial Before You Dig. Please confirm you understand?',

                                                                buttons:
Ext.Msg.YESNO,

                                                                fn:
function(btn)

                                                                {

 
confMsg = null;

 
if(btn=='yes')

 
{

 
node.layer.setVisibility(true); 

 
node.attributes.checked=true;

 
} 

 
else {node.attributes.checked=false;}

                                                                },

 
animateTarget: 'elId',

                                                                icon:
Ext.Msg.QUESTION,

                                                                modal: true

                                                });

                                }

 

}

 

 

 

Brad Spencer

Managing Director,  NuMaps

http://www.numaps.com.au/

tel: 02 9672 6856

mob: 0404 841 131

see my artwork here <http://www.paintingsilove.com/artist/bradspencer> 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110729/b303875b/attachment.htm 


More information about the Users mailing list