I am having some trouble tracking down why this relativily simple
client-side template is performing so poorly.

Using js to make an ajax call and retrieve a small amount of data,
limited to 100 rows being returned.
I've tracked the problem down to the actual jQuery iteration, here is
my code:


function OnSucceeded(results, GPRowID)
        {
            // *** Display all the results.
            $.each(results, function(i){
                if(i<=99){
                    // *** Clone node assign ID attribute
                    var template = $
("#TemplateRowLineItem").clone(true).attr("id", "GPLi_" + GPRowID +
"_" + i);

                    // *** Now fill in the data
 
template.find("#DocumentNumber").text(this.DocumentNumber);
 
template.find("#Description").text(this.Description);
                    template.find("#SubTotal").text(this.SubTotal);
                    template.find("#TaxTotal").text(this.TaxTotal);
                    template.find("#Total").text(this.Total);

                    // Add the template to the bottom of the row that
was clicked
                    template.appendTo($("[EMAIL PROTECTED]" + GPRowID +
"]", "[EMAIL PROTECTED]"));
                }
                else {
                    $
("#TemplateRowMore").clone(true).attr("NextResultPage",+
+currResultPage).appendTo($("[EMAIL PROTECTED]" + GPRowID + "]", "[EMAIL 
PROTECTED]
$=gvBillingHistory]"));
                }
            });
            $("#TemplateRowLoading").remove();
        }

Any help would be greatly appreciated!

Thanks,
Cory

Reply via email to