<?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: Using extjs calendar control (DateField) in ASP.NET</title>
	<atom:link href="http://www.dottostring.com/2009/01/using-extjs-calendar-control-datefield-in-aspnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dottostring.com/2009/01/using-extjs-calendar-control-datefield-in-aspnet/</link>
	<description>Programming is our passion</description>
	<lastBuildDate>Mon, 12 Jul 2010 03:41:39 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Irfan</title>
		<link>http://www.dottostring.com/2009/01/using-extjs-calendar-control-datefield-in-aspnet/comment-page-1/#comment-265</link>
		<dc:creator>Irfan</dc:creator>
		<pubDate>Tue, 17 Nov 2009 21:02:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.dottostring.com/?p=268#comment-265</guid>
		<description>It should work:

&lt;code&gt;DateTime.Parse(txtCalendar.Text);&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>It should work:</p>
<p><code>DateTime.Parse(txtCalendar.Text);</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://www.dottostring.com/2009/01/using-extjs-calendar-control-datefield-in-aspnet/comment-page-1/#comment-264</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Mon, 16 Nov 2009 12:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dottostring.com/?p=268#comment-264</guid>
		<description>There is one catch here though. ExtJS uses the PHP date format notation, which is totally incompatible with the .NET format strings.

This means that you need to write a full translation class to pass date format strings to the calendar control in order to be culture-aware.
This sounds problematic, and is apparently a lot more work than it sounds. Did anyone make something like this yet?</description>
		<content:encoded><![CDATA[<p>There is one catch here though. ExtJS uses the PHP date format notation, which is totally incompatible with the .NET format strings.</p>
<p>This means that you need to write a full translation class to pass date format strings to the calendar control in order to be culture-aware.<br />
This sounds problematic, and is apparently a lot more work than it sounds. Did anyone make something like this yet?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bernardo E</title>
		<link>http://www.dottostring.com/2009/01/using-extjs-calendar-control-datefield-in-aspnet/comment-page-1/#comment-159</link>
		<dc:creator>Bernardo E</dc:creator>
		<pubDate>Wed, 18 Feb 2009 17:44:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.dottostring.com/?p=268#comment-159</guid>
		<description>Thanx!!

the
 Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler); 

worked perfect!!</description>
		<content:encoded><![CDATA[<p>Thanx!!</p>
<p>the<br />
 Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler); </p>
<p>worked perfect!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Irfan Qureshi</title>
		<link>http://www.dottostring.com/2009/01/using-extjs-calendar-control-datefield-in-aspnet/comment-page-1/#comment-99</link>
		<dc:creator>Irfan Qureshi</dc:creator>
		<pubDate>Thu, 22 Jan 2009 15:19:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.dottostring.com/?p=268#comment-99</guid>
		<description>The above code works fine when all the Calendar text boxes are in an update panel, If some text box is outside the update panel, the above code renders the calendar twice with it. So i tweaked it a little like below:
&lt;pre name=&quot;code&quot; class=&quot;js&quot;&gt;
function EndRequestHandler(sender, args) {  
    if (args.get_error() == undefined){
        renderCalendarControls(&quot;updpcalendar&quot;);
    }
 }  
function renderCalendarControls(rel)  
{  
    var textBoxes = Ext.DomQuery.select(&quot;input[rel=&quot; + rel + &quot;]&quot;);  
    Ext.each(textBoxes, function(item, id, all){  
        new Ext.form.DateField({  
        applyTo: item  
        });  
    });  
}  
Ext.onReady(function(){
    renderCalendarControls(&quot;calendar&quot;);renderCalendarControls(&quot;updpcalendar&quot;);
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);  
});
&lt;/pre&gt;

For the text boxes within update panel, I used rel=&quot;updpcalendar&quot; and for the other, I used rel=&quot;calendar&quot;</description>
		<content:encoded><![CDATA[<p>The above code works fine when all the Calendar text boxes are in an update panel, If some text box is outside the update panel, the above code renders the calendar twice with it. So i tweaked it a little like below:</p>
<pre name="code" class="js">
function EndRequestHandler(sender, args) {
    if (args.get_error() == undefined){
        renderCalendarControls("updpcalendar");
    }
 }
function renderCalendarControls(rel)
{
    var textBoxes = Ext.DomQuery.select("input[rel=" + rel + "]");
    Ext.each(textBoxes, function(item, id, all){
        new Ext.form.DateField({
        applyTo: item
        });
    });
}
Ext.onReady(function(){
    renderCalendarControls("calendar");renderCalendarControls("updpcalendar");
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
});
</pre>
<p>For the text boxes within update panel, I used rel=&#8221;updpcalendar&#8221; and for the other, I used rel=&#8221;calendar&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Irfan</title>
		<link>http://www.dottostring.com/2009/01/using-extjs-calendar-control-datefield-in-aspnet/comment-page-1/#comment-93</link>
		<dc:creator>Irfan</dc:creator>
		<pubDate>Tue, 20 Jan 2009 19:16:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.dottostring.com/?p=268#comment-93</guid>
		<description>You will have to call the code inside Ext.onReady() each time after completion of your update panel request. 

I have not tested the following code, but hopefully it will help
&lt;pre name=&quot;code&quot; class=&quot;js&quot;&gt;

function EndRequestHandler(sender, args) {
   if (args.get_error() == undefined)
       renderCalendarControls();
   else
       alert(&quot;There was an error&quot; + args.get_error().message);
}

function renderCalendarControls()
{
	var textBoxes = Ext.DomQuery.select(&quot;input[rel=calendar]&quot;);
	Ext.each(textBoxes, function(item, id, all){
		var cl = new Ext.form.DateField({
			allowBlank : false,
			applyTo: item
		});
	});
}

Ext.onReady(function(){
	renderCalendarControls();
	Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
});
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>You will have to call the code inside Ext.onReady() each time after completion of your update panel request. </p>
<p>I have not tested the following code, but hopefully it will help</p>
<pre name="code" class="js">

function EndRequestHandler(sender, args) {
   if (args.get_error() == undefined)
       renderCalendarControls();
   else
       alert("There was an error" + args.get_error().message);
}

function renderCalendarControls()
{
	var textBoxes = Ext.DomQuery.select("input[rel=calendar]");
	Ext.each(textBoxes, function(item, id, all){
		var cl = new Ext.form.DateField({
			allowBlank : false,
			applyTo: item
		});
	});
}

Ext.onReady(function(){
	renderCalendarControls();
	Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
});
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Irfan Qureshi</title>
		<link>http://www.dottostring.com/2009/01/using-extjs-calendar-control-datefield-in-aspnet/comment-page-1/#comment-82</link>
		<dc:creator>Irfan Qureshi</dc:creator>
		<pubDate>Thu, 15 Jan 2009 10:11:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.dottostring.com/?p=268#comment-82</guid>
		<description>Hi, If I put my text box in an update panel, the calendar disappears after the first postback. Any idea how to fix this?</description>
		<content:encoded><![CDATA[<p>Hi, If I put my text box in an update panel, the calendar disappears after the first postback. Any idea how to fix this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Irfan Qureshi</title>
		<link>http://www.dottostring.com/2009/01/using-extjs-calendar-control-datefield-in-aspnet/comment-page-1/#comment-79</link>
		<dc:creator>Irfan Qureshi</dc:creator>
		<pubDate>Tue, 13 Jan 2009 11:22:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.dottostring.com/?p=268#comment-79</guid>
		<description>Great tip. I was scratching my head throughout last weekend on how to this and now I know. Thanks again.</description>
		<content:encoded><![CDATA[<p>Great tip. I was scratching my head throughout last weekend on how to this and now I know. Thanks again.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
