PDA

View Full Version : Navigating through DOM with Extjs



kqpro1
26 Oct 2015, 5:05 PM
I am having some trouble selecting the element I want on my page. The structure looks like:



<div id="Notepanel-1003_header" class="x-panel-header" style="right: auto; left: 0px; top: 0px; width: 737px;">
<div id="Notepanel-1003-body" class="x-panel-body" style="padding: 10px; width: 737px; height: 423px; left: 0px; top: 44px;" role="presentation" data-ref="body">


I can get it to select the Notepanel-1003_header with


Ext.ComponentQuery.query('Notepanel')[0].down() which gives me <div id="Notepanel-1003_header" class="x-panel-header" style="right: auto; left: 0px; top: 0px; width: 737px;">


But how do i go from here and select Notepanel-1003-body ? These two are on the same level, i tried to add .next() at the end, but it didnt work. Any suggestions?

joel.watson
27 Oct 2015, 7:14 PM
Hi---

You could get the element from the component, and then navigate down() with a CSS selector:


mypanel.getEl().down('.x-panel-body');

Thanks
Joel