Hi...

I got some code running correct, but I'm quite sure it can be written
in a way that it performs better...
I implemented a system that loads rows of a table in batches (using
Anthem ajax). It will be used for print reports with a big amount of
rows.

On the initial load of the page, the first batch is displayed (let's
say 100 data rows + 1 header row). Then I make a callback to retrieve
the next 100 rows. The problem is that each time I also get the header
row of the table.
The header row has a class name 'HeaderRow'. The data rows have 'Row'
as classname.
This is the code I'm using now:

var newContainer = new Element('div');
newContainer.innerHTML = result.controls[controlID]; // this contains
a html table with the header row and data rows
newContainer.select('table.grid tr.Row').each(function(row)
{
        oldContainer.insert(row);
});
delete newContainer;

The part that I would like to optimize is the 'select' of the data
rows and the looping through each of them to insert them at the bottom
of the datarows already on the page.

I would be happy to hear if and how this can be optimized...
With kind regards,

Manu aka TweeZz.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to