<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>.Net and Some (may be MORE) Random Thoughts &#187; DealFlakes</title>
	<atom:link href="http://blog.budigelli.com/tag/dealflakes/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.budigelli.com</link>
	<description></description>
	<lastBuildDate>Tue, 11 May 2010 04:45:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>ASP.NET MVC, JQuery, and SuperFlyDOM</title>
		<link>http://blog.budigelli.com/net/ajax/aspnet-mvc-jquery-and-superflydom-for-user-interface/</link>
		<comments>http://blog.budigelli.com/net/ajax/aspnet-mvc-jquery-and-superflydom-for-user-interface/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 04:18:46 +0000</pubDate>
		<dc:creator>budigelli</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[DealFlakes]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://blog.budigelli.com/?p=45</guid>
		<description><![CDATA[What is JQuery? &#8220;A new type of JavaScript Library&#8221; Jquery really made my UI developement Fun. If you are not familiar with JQuery, i strongly suggest you check it out. We can do more with less code using JQuery. And &#8230; <a href="http://blog.budigelli.com/net/ajax/aspnet-mvc-jquery-and-superflydom-for-user-interface/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>What is JQuery? &#8220;A new type of JavaScript Library&#8221; Jquery really made my UI developement Fun. If you are not familiar with JQuery, i strongly suggest you <a title="Jquery" href="http://jquery.com" target="_blank">check it out</a>. We can do more with less code using JQuery.</p>
<p>And then there is <a title="ASP.NET MVC" href="http://asp.net/mvc" target="_blank">ASP.NET MVC</a> to make make web development clean and TDD friendly. If you are not familiar with ASP.NET MVC you should check out <a title="ASP.NET MVC" href="http://weblogs.asp.net/scottgu/" target="_blank">Scott Gu&#8217;s</a> Blog posts on different previews (currently Preview 4).</p>
<p>There are quite a few articles on how to integrate ASP.NET MVC and JQuery to make our lifes happier. A simple google search for &#8220;<a title="ASP.NET MVC with JQuery" href="http://www.google.com/search?q=asp.net+mvc+with+jquery" target="_blank">ASP.NET MVC with JQuery</a>&#8221; return quite a few articles.</p>
<p><span id="more-45"></span></p>
<p>Here, i am not going to talk about how to use JQuery for communication (for making AJAX Calls) or presentation (Subtle or major UX effects). Insted i am add &#8220;<a title="SuperFlyDOM" href="http://plugins.jquery.com/project/SuperFlyDOM" target="_blank">SuperFlyDOM</a>&#8221; to the mix. The most important part of SuperFlyDOM is the way that it lets us define the Templates. If are making a AJAX call and expecting a JSON Response, the chances are we are expecting a list of objects and would probably need to display them in either a tabular or (un)ordered list to the DOM. SuperFlyDOM is the perfect allay for this situation.</p>
<p>If i have a JSON object with serialized properties (ID, Name, Url), and i want to display/populate these JSON objects to the User by Manipulating the DOM, all i needed to do are the following simple steps&#8230;</p>
<p>I need to create a template (which is very easy depending how complicated you want the item to look after it is rendered) &#8211; To simply display an anchor tag, you could use the following Template</p>
<blockquote><p>var itemTpl = function(){return [<span class="sourceRowText">'a', {href:this.Url, id:this.Id, className:'myclass'}, [this.Name]]};</span></p></blockquote>
<p>I am creating an &#8220;a&#8221; element with properties &#8220;href&#8221;, &#8220;id&#8221;, and &#8220;className&#8221; and it will have the &#8220;Name&#8221; value go in between the &#8220;a&#8221; tag. The good thing about templates is they you can change the way what goes in to the template and how it will be presented (markup) could be changed with out much coupling with the rest of the app.</p>
<p>Once you have the template, you could make a simple call to one of the methods provided by SuperFlyDom, <span class="sourceRowText">tplAppend(jsonObj, itemTpl), foreach JSON object in your collection.  Thats it. This is the best way i have found to deal with JSON objects rendering. If you know any better techniques, please feel free to drop me a line. </span></p>
<p><span class="sourceRowText">Note- You can also do string concatenation on Templates as follows&#8230;</span></p>
<blockquote><p><span class="sourceRowText">var itemTpl= function(){return ['a', {href:'/product/' + this.Name+'/', id:this.ID, className:'myClass'}, [this.Name]]};</span></p></blockquote>
<p>This is one of the few techniques i have used in DealFlakes.Com, <a title="Online Deal Aggregator" href="http://dealflakes.com" target="_blank">Online Deal Aggregator</a>.</p>
<p>Good Luck&#8230;</p>
<p><strong>[update]</strong></p>
<p>I thought its good to include few more sample templates, just to give more info on template creation.</p>
<p>To render the following HTML</p>
<blockquote><p>&lt;div id=&#8221;id-of-the-object&#8221; class=&#8221;someClass&#8221;&gt;&lt;a href=&#8221;/point to some url&#8221; target=&#8221;_blank&#8221; title = &#8220;name-of-the-object&#8221;&gt;name-of-the-object&lt;/a&gt;&lt;/div&gt;</p></blockquote>
<p>our template is going to be something like</p>
<blockquote><p>var itemTps = function() {return ['div', { id:this.Id, className: "someClass"}, ['a', {href:"/point to some url", target: "_blank", title: this.Name }, [this.Name]]]};</p></blockquote>
<p>the key understand the templates are as follows</p>
<ul>
<li>&#8220;[&#8221; is for creating a new element (could be a text element)</li>
</ul>
<ul>
<li>&#8220;{&#8221; represents the attributes of the enclosing elements.</li>
<li>Enclose your elements with single quotation &#8220;&#8216;&#8221; marks</li>
<li>Enclose your attribute values with double quotation &#8220;&#8221;" marks&#8230;</li>
</ul>
<p>Hope this clears few things&#8230; </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.budigelli.com/net/ajax/aspnet-mvc-jquery-and-superflydom-for-user-interface/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ASP.NET MVC Live Example &#8211; DealFlakes</title>
		<link>http://blog.budigelli.com/general/aspnet-mvc-live-example-dealflake/</link>
		<comments>http://blog.budigelli.com/general/aspnet-mvc-live-example-dealflake/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 05:53:16 +0000</pubDate>
		<dc:creator>budigelli</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[DealFlakes]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://blog.budigelli.com/?p=44</guid>
		<description><![CDATA[I have had been using DealFlakes.com as my technical playground for a while. I have experimented with some cool AJAX JSON based communication and some nifty Server side tricks. With the arrival (well, the previews) of ASP.NET MVC, I was &#8230; <a href="http://blog.budigelli.com/general/aspnet-mvc-live-example-dealflake/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have had been using <a title="DealFlakes" href="http://dealflakes.com" target="_blank">DealFlakes.com</a> as my technical playground for a while. I have experimented with some cool AJAX JSON based communication and some nifty Server side tricks. With the arrival (well, the previews) of ASP.NET MVC, I was so excited that i wanted to re-write the DealFlakes.com on MVC framework (not a lot once i know what i wanted to do and how to organize the data).</p>
<p>DealFlakes is basically a <a title="Deal Aggregator" href="http://dealflakes.com" target="_blank">Deal Aggregation portal</a> !</p>
<ol>
<li><a title="JQUERY" href="http://jquery.com" target="_blank">JQUERY</a> (for communication and User Experience effects)</li>
<li>LINQ &#8211; (Linq-to-SQL and Linq-to-XML to talk to my data stores)</li>
<li>And at this point <a title="ASP.NET MVC Preview 4" href="http://weblogs.asp.net/scottgu/archive/2008/07/14/asp-net-mvc-preview-4-release-part-1.aspx" target="_blank">ASP.NET MVC Preview 4</a> (I love the caching and Authentication modules in this preview)</li>
<li>SQL Server (2005) with some XML files</li>
<li>And hosted on IIS7 (Windows Server 2008)</li>
</ol>
<p>I have learned quite a bit of JavaScript while working with <a title="Jquery" href="http://jquery.com" target="_blank">Jquery</a> and i encourage all of you to have a look at it. I am sure, you are going to love it. And my CSS skills are getting better <img src='http://blog.budigelli.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Well, layout is kind of similar to <a title="Digg" href="http://digg.com" target="_blank">Digg</a>, umm(they invented the wheel)!!!</p>
<p>Any how, if you are a bargain hunter and would like to keep some money in your pocket (May be more available balance on your credit card) you should check out <a title="dealflakes" href="http://dealflakes.com" target="_blank">dealflakes.com</a>. I am going to keep this as a serious website and not going to play with it any more (at least that effects the Functionality and User Experience). And yes, i will be adding some very exciting features very soon. So, stay tuned.</p>
<p>Go <a title="DealFlakes" href="http://dealflakes.com" target="_blank">DealFlakes&#8230;</a></p>
<p>Budigelli </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.budigelli.com/general/aspnet-mvc-live-example-dealflake/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

