<?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: Extending jQuery UI Widgets</title>
	<atom:link href="http://bililite.com/blog/extending-jquery-ui-widgets/feed/" rel="self" type="application/rss+xml" />
	<link>http://bililite.com/blog</link>
	<description>Thoughts on web design and programming from a very occasional volunteer webmaster</description>
	<lastBuildDate>Thu, 22 Jul 2010 22:04:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Danny</title>
		<link>http://bililite.com/blog/extending-jquery-ui-widgets/comment-page-1/#comment-1633</link>
		<dc:creator>Danny</dc:creator>
		<pubDate>Thu, 22 Jul 2010 22:04:04 +0000</pubDate>
		<guid isPermaLink="false">http://bililite.com/blog/?page_id=305#comment-1633</guid>
		<description>@Lee
Unfortunately, my life is kind of busy now, but I&#039;ll try to take a look at this. It looks like it ought to work, but there may be something going on where the event handler is being bound before the subclass really exists, so it&#039;s binding to the superclass.
Danny</description>
		<content:encoded><![CDATA[<p>@Lee<br />
Unfortunately, my life is kind of busy now, but I&#8217;ll try to take a look at this. It looks like it ought to work, but there may be something going on where the event handler is being bound before the subclass really exists, so it&#8217;s binding to the superclass.<br />
Danny</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lee</title>
		<link>http://bililite.com/blog/extending-jquery-ui-widgets/comment-page-1/#comment-1625</link>
		<dc:creator>Lee</dc:creator>
		<pubDate>Mon, 19 Jul 2010 12:58:44 +0000</pubDate>
		<guid isPermaLink="false">http://bililite.com/blog/?page_id=305#comment-1625</guid>
		<description>@Danny:
Hopefully this bit of code sums it up:

$.ui.widget.subclass(&#039;ui.superwidget&#039;,
	{
		_init: function()
		{
			// can&#039;t catch this
			this._trigger(&#039;anevent&#039;);

			// can catch this
			this.element.trigger(&#039;superwidgetanevent&#039;);
		}
	});

And creation and binding:
$(&#039;#test&#039;).bind(&#039;superwidgetanevent&#039;, function()
{
	console.log(&#039;an event happened&#039;)
});
$(&#039;#test&#039;).superwidget();</description>
		<content:encoded><![CDATA[<p>@Danny:<br />
Hopefully this bit of code sums it up:</p>
<p>$.ui.widget.subclass(&#8216;ui.superwidget&#8217;,<br />
	{<br />
		_init: function()<br />
		{<br />
			// can&#8217;t catch this<br />
			this._trigger(&#8216;anevent&#8217;);</p>
<p>			// can catch this<br />
			this.element.trigger(&#8216;superwidgetanevent&#8217;);<br />
		}<br />
	});</p>
<p>And creation and binding:<br />
$(&#8216;#test&#8217;).bind(&#8216;superwidgetanevent&#8217;, function()<br />
{<br />
	console.log(&#8216;an event happened&#8217;)<br />
});<br />
$(&#8216;#test&#8217;).superwidget();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danny</title>
		<link>http://bililite.com/blog/extending-jquery-ui-widgets/comment-page-1/#comment-1612</link>
		<dc:creator>Danny</dc:creator>
		<pubDate>Wed, 14 Jul 2010 02:28:10 +0000</pubDate>
		<guid isPermaLink="false">http://bililite.com/blog/?page_id=305#comment-1612</guid>
		<description>@Lee:
I haven&#039;t had any problems with event triggering, but I may not be using the code the same way you are. Can you post some more details?
--Danny</description>
		<content:encoded><![CDATA[<p>@Lee:<br />
I haven&#8217;t had any problems with event triggering, but I may not be using the code the same way you are. Can you post some more details?<br />
&#8211;Danny</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lee</title>
		<link>http://bililite.com/blog/extending-jquery-ui-widgets/comment-page-1/#comment-1598</link>
		<dc:creator>Lee</dc:creator>
		<pubDate>Tue, 06 Jul 2010 14:25:41 +0000</pubDate>
		<guid isPermaLink="false">http://bililite.com/blog/?page_id=305#comment-1598</guid>
		<description>I can&#039;t seem to catch any events I trigger in these widget subclasses. I call this._trigger as usual but can not seem to catch the event in the normal way.</description>
		<content:encoded><![CDATA[<p>I can&#8217;t seem to catch any events I trigger in these widget subclasses. I call this._trigger as usual but can not seem to catch the event in the normal way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Interval an Objekt hängen (jQuery) - php.de</title>
		<link>http://bililite.com/blog/extending-jquery-ui-widgets/comment-page-1/#comment-1576</link>
		<dc:creator>Interval an Objekt hängen (jQuery) - php.de</dc:creator>
		<pubDate>Wed, 09 Jun 2010 05:40:13 +0000</pubDate>
		<guid isPermaLink="false">http://bililite.com/blog/?page_id=305#comment-1576</guid>
		<description>[...] ui factory. Insbesondere wäre wohl die ui.progressbar für dich interessanter.  ui developer guide extending ui widgets  richtig gutes Tutorial auf deutsch: ui factory am Beispiel einer canvas map I ui factory am [...]</description>
		<content:encoded><![CDATA[<p>[...] ui factory. Insbesondere wäre wohl die ui.progressbar für dich interessanter.  ui developer guide extending ui widgets  richtig gutes Tutorial auf deutsch: ui factory am Beispiel einer canvas map I ui factory am [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danny</title>
		<link>http://bililite.com/blog/extending-jquery-ui-widgets/comment-page-1/#comment-1373</link>
		<dc:creator>Danny</dc:creator>
		<pubDate>Thu, 25 Mar 2010 03:01:07 +0000</pubDate>
		<guid isPermaLink="false">http://bililite.com/blog/?page_id=305#comment-1373</guid>
		<description>@alpha:
jQuery UI 1.8 just came out and broke everything. I&#039;m going to have to rewrite this, sometime over the next two weeks, to use the new widget factory. I think it will be better, but don&#039;t count on anything working  (or go back to jQuery 1.7.2) until then.
--Danny</description>
		<content:encoded><![CDATA[<p>@alpha:<br />
jQuery UI 1.8 just came out and broke everything. I&#8217;m going to have to rewrite this, sometime over the next two weeks, to use the new widget factory. I think it will be better, but don&#8217;t count on anything working  (or go back to jQuery 1.7.2) until then.<br />
&#8211;Danny</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alpha</title>
		<link>http://bililite.com/blog/extending-jquery-ui-widgets/comment-page-1/#comment-1370</link>
		<dc:creator>alpha</dc:creator>
		<pubDate>Wed, 24 Mar 2010 20:52:38 +0000</pubDate>
		<guid isPermaLink="false">http://bililite.com/blog/?page_id=305#comment-1370</guid>
		<description>very nice tutorial.
I got a issue when a call to destroy is made: $.widget.prototype.apply is not a function
any clue?</description>
		<content:encoded><![CDATA[<p>very nice tutorial.<br />
I got a issue when a call to destroy is made: $.widget.prototype.apply is not a function<br />
any clue?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danny</title>
		<link>http://bililite.com/blog/extending-jquery-ui-widgets/comment-page-1/#comment-1334</link>
		<dc:creator>Danny</dc:creator>
		<pubDate>Sun, 14 Mar 2010 07:38:04 +0000</pubDate>
		<guid isPermaLink="false">http://bililite.com/blog/?page_id=305#comment-1334</guid>
		<description>@Christoph:
That&#039;s got to be one of those quirk about named functions that is so inconsistent between javascript implementations. This one works in all the major browsers but evidently Dojo&#039;s Shrinksafe parses the javascript differently. Thanks for the heads up!
(And why were you using Dojo? I had to ask! :) )
--Danny</description>
		<content:encoded><![CDATA[<p>@Christoph:<br />
That&#8217;s got to be one of those quirk about named functions that is so inconsistent between javascript implementations. This one works in all the major browsers but evidently Dojo&#8217;s Shrinksafe parses the javascript differently. Thanks for the heads up!<br />
(And why were you using Dojo? I had to ask! <img src='http://bililite.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )<br />
&#8211;Danny</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christoph</title>
		<link>http://bililite.com/blog/extending-jquery-ui-widgets/comment-page-1/#comment-1330</link>
		<dc:creator>Christoph</dc:creator>
		<pubDate>Fri, 12 Mar 2010 10:54:51 +0000</pubDate>
		<guid isPermaLink="false">http://bililite.com/blog/?page_id=305#comment-1330</guid>
		<description>Hey Danny,
just a minor quirk I encountered, when using Dojo Shrinksafe compression (don&#039;t ask me why ;).

In the line:  widget.subclass = subclass;
The &quot;subclass&quot; function reference is treated as an internal variable, and thus hashed to:
widget.subclass = _10;

Which of course fails at runtime.
I fixed that by using the namespaced function ref:

widget.subclass = $.ui.widget.subclass;

Other than that, works great.

Christoph</description>
		<content:encoded><![CDATA[<p>Hey Danny,<br />
just a minor quirk I encountered, when using Dojo Shrinksafe compression (don&#8217;t ask me why <img src='http://bililite.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
<p>In the line:  widget.subclass = subclass;<br />
The &#8220;subclass&#8221; function reference is treated as an internal variable, and thus hashed to:<br />
widget.subclass = _10;</p>
<p>Which of course fails at runtime.<br />
I fixed that by using the namespaced function ref:</p>
<p>widget.subclass = $.ui.widget.subclass;</p>
<p>Other than that, works great.</p>
<p>Christoph</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danny</title>
		<link>http://bililite.com/blog/extending-jquery-ui-widgets/comment-page-1/#comment-1311</link>
		<dc:creator>Danny</dc:creator>
		<pubDate>Sun, 28 Feb 2010 22:17:06 +0000</pubDate>
		<guid isPermaLink="false">http://bililite.com/blog/?page_id=305#comment-1311</guid>
		<description>@Valentino:
I think you actually meant this comment for the &lt;a href=&quot;/blog/understanding-jquery-ui-widgets-a-tutorial/&quot; rel=&quot;nofollow&quot;&gt;Widget Tutorial&lt;/a&gt;. Notwithstanding that, there&#039;s a subtlety here about how javascript handles prototypal inheritance: &lt;code&gt;level&lt;/code&gt; is a variable in the &lt;em&gt;prototype&lt;/em&gt;, so it is &lt;em&gt;not&lt;/em&gt; copied into each instance. &lt;code&gt;this.level&lt;/code&gt; refers to the prototype&#039;s &lt;code&gt;level&lt;/code&gt;, which is shared with all instances. the general rule: when I refer to &lt;code&gt;this.foo&lt;/code&gt;, Javascript searched the object for a property named &lt;code&gt;foo&lt;/code&gt;, then the object&#039;s prototype, then the prototype&#039;s prototype, etc. If nothing is found, a new property is created in the individual object.
--Danny</description>
		<content:encoded><![CDATA[<p>@Valentino:<br />
I think you actually meant this comment for the <a href="/blog/understanding-jquery-ui-widgets-a-tutorial/" rel="nofollow">Widget Tutorial</a>. Notwithstanding that, there&#8217;s a subtlety here about how javascript handles prototypal inheritance: <code>level</code> is a variable in the <em>prototype</em>, so it is <em>not</em> copied into each instance. <code>this.level</code> refers to the prototype&#8217;s <code>level</code>, which is shared with all instances. the general rule: when I refer to <code>this.foo</code>, Javascript searched the object for a property named <code>foo</code>, then the object&#8217;s prototype, then the prototype&#8217;s prototype, etc. If nothing is found, a new property is created in the individual object.<br />
&#8211;Danny</p>
]]></content:encoded>
	</item>
</channel>
</rss>
