PDA

View Full Version : How to use DomQuery to jump to particular element



dbassett74
11 Jul 2010, 8:03 AM
I'm not quite sure how to utilize the DomQuery to achieve the following.

I have an html page loaded in a Panel. It is long and requires scrolling. I have particular elements in the html such as:

<a name="hit1">blabla</a>
<a name="hit2">blablabla</a>
...

Using the DomQuery, how would I jump to one of the above at a time? In other words, if <a name="hit1"> is not currently in view, it would automatically scroll this element into view.

Any help would be appreciated.

dbassett74
11 Jul 2010, 8:12 AM
I see from another post that I don't need to use DomQuery directly but rather, Ext.select(). So here's what I'm trying now, but it is not working:



Ext.select("a.hit2").scrollIntoView();
What am I missing?

dbassett74
12 Jul 2010, 6:49 AM
bump