javascript - ExtJs window doesn't show -


i have toggle button:

        var button =  new ext.button({         tooltip: "Интенсивность",         iconcls: "gxp-icon-intensity",         enabletoggle:true,         togglehandler: function (button, state) {             if(state){                 alert(state)                 map.getlayersbyname("Интенсивность")[0].setvisibility(true);                 intwin.show();             }else{                 map.getlayersbyname("Интенсивность")[0].setvisibility(false);                 alert(intwin.collapsed);                 //intwin.close();             }         }     }); 

and when button toggled show window:

    var intwin = new ext.window({         id: 'intwin',          layout: 'fit',         title:'Интенсивность',         autoscroll:false,         width:300,         items:[/*intform*/]     }); 

when close window, button un-toggles. when click again don't window. firebug shows error:

 typeerror: b.dom undefined  ...string(this.enableurlencode)?this.enableurlencode:"data"]=ext.encode(b);g.params... 

what can wrong here?

update

okey,my bad. tried show destroyed element.

but in case:
1 when close window , destroyed, forms in window destroyed too?
2 how can check window destroyed?

update2

now try function creating window:

    function intwincreate(){         var intwin = new ext.window({             id: 'intwin',              layout: 'fit',             title:'Интенсивность',             autoscroll:false,             width:300,             items:[/*intform*/]         });     }; 

and in button handler:

                intwincreate();                 intwin.show(); 

but error:

  referenceerror: intwin not defined 

if put intwin.show(); function window shows.
can wrong?

when element destroyed within destroyed.

in case change default behaviour of close action hide setting property closeaction: 'hide' cause window hide instead of getting destroyed.

ex:

var intwin = new ext.window({     id: 'intwin',      layout: 'fit',     closeaction: 'hide',     title:'Интенсивность',     autoscroll:false,     width:300,     items:[/*intform*/] }); 

update:
because intwin local variable in method intwincreate. can return window method , call show on it.

function intwincreate(){     return new ext.window({         id: 'intwin',          layout: 'fit',         title:'Интенсивность',         autoscroll:false,         width:300,         items:[/*intform*/]     }); }; 

then

intwincreate().show() 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -