extjs4.1 - ExtJS: Second Modal Window causing error: Uncaught TypeError: Cannot read property 'addCls' of null -


i getting error: "uncaught typeerror: cannot read property 'addcls' of null" in following scenario.

i have requirement of 2 modal windows. first modal window has grid. when double click on grid in first modal window, should open second modal window. below code used:

  saleorderemployeegrid.on('celldblclick', function(tableview, td, cellindex, record, tr, rowindex, e, eopts){     loadactivitywindow();   });   }    function loadactivitywindow()   {         jobslotactivitywin = new ext.window({         id          :'jobslotactivitywinid',         modal       : true,         layout      : 'fit',         width       : 900,         height      : 500,         closeaction :'destroy',         plain       : true,         model       : true,         stateful    : false,         title       :'create job slot',         items       : [soactivitypanel],         buttons     : [{             text        : 'close',             handler     : function(){                             jobslotactivitywin.destroy();                         }             }         ]          });         jobslotactivitywin.show();         ext.windowmanager.register (createjobslotwin); // createjobslotwin first modal window         ext.windowmanager.register(jobslotactivitywin); // jobslotactivitywin second modal window created above         ext.windowmanager.bringtofront ('jobslotactivitywinid');   } 

so, when double click on saleorderemployeegrid, see second modal window fine. close second modal window , double click on grid again on first modal window.

this doesn't bring second modal window. goes masked , blank in background of first modal window , see below error in javascript console: uncaught typeerror: cannot read property 'addcls' of null

to more precise, error seems coming out of jobslotactivitywin.show() debug logs failed @ point.

anyone faced before , can me?

set closeaction hide, not sure why default destroy means when window closed element removed dom , show not work anymore.

http://docs.sencha.com/extjs/4.2.1/#!/api/ext.panel.panel-cfg-closeaction

reply comments:

conditional create example

//the window created once, data show , updated.  if(!this.win) {     this.win = createwindow(); }  updatewindowdata(); this.win.show(); 

instead of saying closeaction:'hide' everywhere, have in our source

ext.override(ext.window, {     closeaction: 'hide' }) 

if put snippet before windows created of them closeaction hide default.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -