I know I must be being a complete idiot here, but I'm having trouble with jQuery and something I need to do.
I have dynamic webapps that will build large tables of data that I need to get extracted to XML and sent up to my server via Ajax.
The first step is to simply get a wrapped set of all the tables that are containers for the information inside. And with that set, I fire off an iterator to get the innards. Each of the tables that I'll encounter can be completely different, so I need to further query the individual table that I'm currently sitting on in the iterator. Example:
var tables = $('.ruleTemplate').each(function() {
}
... so now inside the function() I can use $(this) to get access to the individual table. What I want to do is ask the (this) dom element for all TR elements inside of it, then for each row I need to ask for all selects and inputs.
In sort of a pseudo-BASIC combined with jQuery what I'm trying to do would look like this:
tables = $('TABLE');
for i = 0 to tables.length
rows = tables[i].$('TR') // note here that I am jQuerying for rows ONLY from the (nth) table
for j = 0 to rows.length
selects = rows[j].$('SELECT') // same here ... looking for selects that are children of the current row...
inputs = rows[j].$('INPUT')
// Do stuff here now with the selects and inputs I've grabbed
next j
next i
I guess another way of saying this is that I'd like to do a jQuery search of a chunk of the DOM that is NOT the whole page ... I'd like to start from an element of my choosing. In Javascript I can say someElement.getElementsByTagName('TR') and it will search with someElement as the root and go deeper - it will not return everything from the whole page.
Probably something enormously simple and I'm missing it, appreciate any help
