In my extjs project, I have a panel to which I show the toolbar on mouseEnter . This is working fine. But when I just update the panel with the new html, the mouseEnter event mouseEnter not work on it.
panel.update('hello');
Then I realized through the Chrome developer tool that the update method erases the last nested inner div panel before applying new text to it (for example, βhelloβ).
Each panel has a 3/4 nested div, but when we use update (), does the panel have only 2 nested div's?
This was the main reason that the mouseEnter event did not mouseEnter on the panel , because I think Ext cannot identify panel as a valid panel after the update() method.
In any case, I later resolved this issue by checking the panel variable in the Chrome console, as shown below.
panel.body.dom.childNodes[0].children[0].childNodes[0].data = 'hello';
The above implementation seems disgusting, but it worked for me. Any other good way to do this?
Edit :
//In controller this.control({ '#monthCalendar>panel>panel': { render: function(container){ container.on('mouseenter',function(){ //do something here },container,{element: 'el'}); } } })
Before updating :
<div class="x-panel x-box-item x-panel-default" id="panel-1078" style="left: 870px; top: 0px; margin: 0px; width: 174px; height: 52px;"> <div id="panel-1078-body" class="x-panel-body x-panel-body-default x-panel-body-default x-box-layout-ct" style="width: 174px; height: 52px; left: 0px; top: 0px;"> <div id="panel-1078-innerCt" class="x-box-inner " role="presentation" style="height: 50px; width: 172px;"> <div id="panel-1078-targetEl" style="position: absolute; width: 172px; left: 0px; top: 0px; height: 1px;"> March 01 </div> </div> </div> </div>
After update :
<div class="x-panel x-box-item x-panel-default" id="panel-1078" style="left: 870px; top: 0px; margin: 0px; width: 174px; height: 52px;"> <div id="panel-1078-body" class="x-panel-body x-panel-body-default x-panel-body-default x-box-layout-ct" style="width: 174px; height: 52px; left: 0px; top: 0px;"> February 01 </div> </div>
I am available in Sencha chat chat .
Mr_Green
source share