1

I have a TabContainer with different tabs (ContentPanes). I am loading each type dynamically when the user selects something from a tree. I would like to be able to run a certain JS function on the newly loaded ContentPane/Tab. So something in this form:

dojo.forEach(
    dojo.query("select"),
        function(selectTag) {
            selectTag.disabled = true;
    }
);

However, I only want to process this on the newly loaded ContentPane/Tab... so let's say given a ContentPane/Tab Dojo Object, how do I do a forEach/query on its content only?

Thanks

Ayyoudy
  • 3,641
  • 11
  • 47
  • 65

1 Answers1

2

You can give dojo.query a second argument telling it in which DOM node to start looking. So if you have a ContentPane with id "fooTab", you can do:

dojo.forEach(dojo.query("select", "fooTab"), 
    function(selectTag) {
        ....
    }
);

Now, technically, "fooTab" is the "dijit ID", but the dijit's/ContentPane's outermost DOM node will also have an id "fooTab". Perhaps not the kosher way, but it works.

Frode
  • 5,600
  • 1
  • 25
  • 25
  • Yup, I just ran into an example that uses the second parameter and was about to post the answer to my own question - but you were quicker :) – Ayyoudy Jul 08 '11 at 15:26