<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Accessing controls inside a Repeater from Javascript</title>
	<atom:link href="http://riotingbits.com/2009/accessing-controls-inside-a-repeater-from-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://riotingbits.com/2009/accessing-controls-inside-a-repeater-from-javascript/</link>
	<description>an uncontrollable .net blog</description>
	<lastBuildDate>Thu, 15 Jul 2010 15:23:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Dan Dumitru</title>
		<link>http://riotingbits.com/2009/accessing-controls-inside-a-repeater-from-javascript/comment-page-1/#comment-202</link>
		<dc:creator>Dan Dumitru</dc:creator>
		<pubDate>Sat, 13 Mar 2010 16:59:20 +0000</pubDate>
		<guid isPermaLink="false">http://riotingbits.com/?p=211#comment-202</guid>
		<description>Da, e o idee buna cache-uitul ID-urilor.

N-o sa actualizez codul din articol, pentru ca l-ar face un pic prea complicat. Dar, cand voi avea data viitoare nevoie de executii mai rapide, imi va prinde bine.

Mersi!</description>
		<content:encoded><![CDATA[<p>Da, e o idee buna cache-uitul ID-urilor.</p>
<p>N-o sa actualizez codul din articol, pentru ca l-ar face un pic prea complicat. Dar, cand voi avea data viitoare nevoie de executii mai rapide, imi va prinde bine.</p>
<p>Mersi!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adrian Vintu</title>
		<link>http://riotingbits.com/2009/accessing-controls-inside-a-repeater-from-javascript/comment-page-1/#comment-200</link>
		<dc:creator>Adrian Vintu</dc:creator>
		<pubDate>Fri, 12 Mar 2010 21:34:43 +0000</pubDate>
		<guid isPermaLink="false">http://riotingbits.com/?p=211#comment-200</guid>
		<description>Salut Dan,

O sugestie: trebuie neaparat sa cache-uiesti controalele daca poti.

De exemplu:

if (!cache[rowNo])
  cache[rowNo] = document.getElementById(repeaterId + &#039;_ctl&#039; + rowNo + &#039;_lblPercent&#039;);
cache[rowNo].innerHTML = percent;

Incerca sa vezi performanta. E o diferenta imensa dupa prima accesare.

Sper sa iti fie de ajutor tip-ul :)

BR,
Adrian Vintu

PS daca ai cumva un mobil Android (sau colegii), poti sa intri aci http://dex.adrianvintu.com pentru niste aplicatii de ale mele :)</description>
		<content:encoded><![CDATA[<p>Salut Dan,</p>
<p>O sugestie: trebuie neaparat sa cache-uiesti controalele daca poti.</p>
<p>De exemplu:</p>
<p>if (!cache[rowNo])<br />
  cache[rowNo] = document.getElementById(repeaterId + &#8216;_ctl&#8217; + rowNo + &#8216;_lblPercent&#8217;);<br />
cache[rowNo].innerHTML = percent;</p>
<p>Incerca sa vezi performanta. E o diferenta imensa dupa prima accesare.</p>
<p>Sper sa iti fie de ajutor tip-ul <img src='http://riotingbits.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>BR,<br />
Adrian Vintu</p>
<p>PS daca ai cumva un mobil Android (sau colegii), poti sa intri aci <a href="http://dex.adrianvintu.com" rel="nofollow">http://dex.adrianvintu.com</a> pentru niste aplicatii de ale mele <img src='http://riotingbits.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Dumitru</title>
		<link>http://riotingbits.com/2009/accessing-controls-inside-a-repeater-from-javascript/comment-page-1/#comment-111</link>
		<dc:creator>Dan Dumitru</dc:creator>
		<pubDate>Wed, 02 Dec 2009 22:35:03 +0000</pubDate>
		<guid isPermaLink="false">http://riotingbits.com/?p=211#comment-111</guid>
		<description>Woa... Thanks for giving your thought on the problem. Quite an honour, actually.

I&#039;ve put your code into my solution. I had to change just some minor things, like using &quot;span&quot; in JS instead of &quot;label&quot; (the Label in asp.net renders as a span) and checking for &#039;&#039; and NaN when adding values.
Anyway... It is a nicer approach, but it&#039;s still slower than going after their built-up IDs, with the most basic methods.
My bechmarking was not the most thouroughly, but still (execution time of the &quot;update calculations&quot; method):
My basic JS way:
- IE8: ~17ms
- IE8-CM: ~22.5ms
This jQuery approach:
- IE8: ~143ms
- IE8-CM: ~170ms
(CM - Compatibility Mode)

It&#039;s not at all too much for this example, but for a big form I had at work, it takes like 1 sec for the full calculations. And 2 sec would be too much.

I do have to admit the jQuery-newbie in me learned some stuff from your code.</description>
		<content:encoded><![CDATA[<p>Woa&#8230; Thanks for giving your thought on the problem. Quite an honour, actually.</p>
<p>I&#8217;ve put your code into my solution. I had to change just some minor things, like using &#8220;span&#8221; in JS instead of &#8220;label&#8221; (the Label in asp.net renders as a span) and checking for &#8221; and NaN when adding values.<br />
Anyway&#8230; It is a nicer approach, but it&#8217;s still slower than going after their built-up IDs, with the most basic methods.<br />
My bechmarking was not the most thouroughly, but still (execution time of the &#8220;update calculations&#8221; method):<br />
My basic JS way:<br />
- IE8: ~17ms<br />
- IE8-CM: ~22.5ms<br />
This jQuery approach:<br />
- IE8: ~143ms<br />
- IE8-CM: ~170ms<br />
(CM &#8211; Compatibility Mode)</p>
<p>It&#8217;s not at all too much for this example, but for a big form I had at work, it takes like 1 sec for the full calculations. And 2 sec would be too much.</p>
<p>I do have to admit the jQuery-newbie in me learned some stuff from your code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://riotingbits.com/2009/accessing-controls-inside-a-repeater-from-javascript/comment-page-1/#comment-110</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Tue, 01 Dec 2009 17:57:33 +0000</pubDate>
		<guid isPermaLink="false">http://riotingbits.com/?p=211#comment-110</guid>
		<description>If you&#039;re interested, you could avoid the ID substring search by doing something like this:

&lt;code&gt;  $(&#039;tbody tr&#039;).each(function(i, item) { 
    var $item = $(item); 
     
    var percentage = $item.find(&#039;input&#039;).val() / totalVisitors * 100; 
     
    percentage = percentage.toFixed(1) + &#039;%&#039;; 
     
    $item.find(&#039;label&#039;).text(percentage); 
  }); &lt;/code&gt;

That will select everything with getElementsByTagName, which is fast even in IE6.  You&#039;d just need to change your markup slightly, wrapping the Repeater in a tbody so it&#039;s faster/easier to exclude the heading rows.

I put a rough example up on JSBin.  It could use some refactoring, but should perform decently:  http://jsbin.com/izexu/edit</description>
		<content:encoded><![CDATA[<p>If you&#8217;re interested, you could avoid the ID substring search by doing something like this:</p>
<p><code>  $('tbody tr').each(function(i, item) {<br />
    var $item = $(item); </p>
<p>    var percentage = $item.find('input').val() / totalVisitors * 100; </p>
<p>    percentage = percentage.toFixed(1) + '%'; </p>
<p>    $item.find('label').text(percentage);<br />
  }); </code></p>
<p>That will select everything with getElementsByTagName, which is fast even in IE6.  You&#8217;d just need to change your markup slightly, wrapping the Repeater in a tbody so it&#8217;s faster/easier to exclude the heading rows.</p>
<p>I put a rough example up on JSBin.  It could use some refactoring, but should perform decently:  <a href="http://jsbin.com/izexu/edit" rel="nofollow">http://jsbin.com/izexu/edit</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->