[jQuery] Re: Poor Performing jQuery .each()

2008-10-08 Thread Coryt
Sorry for the last question, I realize what is happening now. It seems to be a quirk of the .html() which only ouputs the inner html, so it's not a problem with the clone like I originally thought.

[jQuery] Re: Poor Performing jQuery .each()

2008-10-08 Thread Coryt
I noticed something else that is a little weird when cloning. If I execute the following snippet, I see the table tags and all the inner html: var $template = $("#LineItemsTableTemplate").clone() alert($template.html()); Item Code Price Level De

[jQuery] Re: Poor Performing jQuery .each()

2008-10-08 Thread Coryt
Dave, missed your last question, yes, because of the initial performance issue I was having, I was limiting my SQL resultset to be exactly 100 and if there were more rows available, I appended a blank row making 101 rows all the time. Therefore I could always tell that if I had 101 rows, more reco

[jQuery] Re: Poor Performing jQuery .each()

2008-10-08 Thread Coryt
Thanks for all the tips Michael and Dave, very much appreciated. Michael, to answer your questions, there is a way to get the .Net generated prefix, and I did mean to use insertAfter. It rendered correctly in IE but not in FF so I didn't notice it immediately. I have been busy with a few other t

[jQuery] Re: Poor Performing jQuery .each()

2008-10-07 Thread Dave Methvin
I am thinking Mike is right, and you wanted insertAfter rather than appendTo. > I could build a local string, then once the loop finishes, > append the string where I need it. Don't give up on your DOM approach yet,the performance of the [id$=] selector may be the killer and your current approac

[jQuery] Re: Poor Performing jQuery .each()

2008-10-07 Thread Michael Geary
Great, now (I think) I'm understanding better what you're doing. Is there no way to find out what that .NET-assigned prefix is? That would let you do a direct #id lookup. If you can't do that, one thing that will speed up the selectors a lot is to add the tagname. Also, it appears that the pref

[jQuery] Re: Poor Performing jQuery .each()

2008-10-07 Thread Coryt
Ah, yes, sorry, the @ selectors are because I am using .net, which alters rendered control ID values. Therefore I need to search for the end of the ID. >From what i read and as you noted, the selector $( "[EMAIL PROTECTED]" + GPRowID + "]", "[EMAIL PROTECTED]" ), would use "[EMAIL PROTECTED] $=gvB

[jQuery] Re: Poor Performing jQuery .each()

2008-10-07 Thread Michael Geary
Next thing I want to see is the HTML that the code you generate is being inserted into. I'm having trouble following this selector: $( "[EMAIL PROTECTED]" + GPRowID + "]", "[EMAIL PROTECTED]" ) My guess is that the @ characters are left over from some old jQuery syntax? And so it would find an e

[jQuery] Re: Poor Performing jQuery .each()

2008-10-07 Thread Jörn Zaefferer
Try jsbin.com for a testpage: http://jsbin.com/ Jörn On Tue, Oct 7, 2008 at 4:20 PM, Coryt <[EMAIL PROTECTED]> wrote: > > Unfortunately I don't have a place to put up a test page. > Here is the html template: > > > > > > >

[jQuery] Re: Poor Performing jQuery .each()

2008-10-07 Thread Coryt
Unfortunately I don't have a place to put up a test page. Here is the html template:

[jQuery] Re: Poor Performing jQuery .each()

2008-10-07 Thread Michael Geary
Ah, my mistake. I saw all the template.find() calls and didn't pay close enough attention. OK, now it's clear that the problem is all the DOM manipulation inside the loop. (The performance of $.each() itself is the least of your worries.) You can easily speed this up by a factor of 10 or more by

[jQuery] Re: Poor Performing jQuery .each()

2008-10-07 Thread Coryt
Actually the data is being returned as json. sample data: [ { "LineItemType":2, "DocumentNumber":"COM", "Description":"DREG09-rbl2105-1000.com", "SubTotal":7.74000, "TaxTotal":0.39000, "Total":8.13000, "Quantity":1.0 }, {

[jQuery] Re: Poor Performing jQuery .each()

2008-10-06 Thread Michael Geary
Is there any possibility that you can get JSON data instead of XML? It will be *much* faster. If not, then we can talk about how to optimize the XML parsing and jQuery operations - although that is a much tougher question. -Mike > I am having some trouble tracking down why this relativily > si