PDA

View Full Version : How can select current day date and future day date only ?



Sandeep
6 Jan 2011, 11:51 PM
Hi,
I am using extjs 3.3, I am facing a problem.
I have made a page index.html and index.js. Inside index.js i have some field in formPanel(like textfield, datefield).
I have calender.js file for calender.
Inside formpanel i have a textfield that name is "Return" and i am performing clickevent on that textbox, calender would be open. when i select past, current and future day date its work fine.
Now i want select current day date and future day date only not a past date from my calender.
If try to click past day date it should not be select.
And also past day date should be open in different color from current and future day date in calender.
So, i want a help regarding How can select current day date and future day date only??
what and where i write code ??
The link to my html page in http://m.globester.com
Here is the code which i use.

{
xtype:'textfield',
fieldLabel: 'Return',
width:240,
name: 'return',
id: 'return',
cls: 'sh_border',
emptyText:'Enter Date',
readOnly:true,
handleMouseEvents: true,
listeners: {
'render': function(cmp){
Ext.getCmp('return').getEl().on('click', function(){
homeCalendar = new Ext.ux.Calendar({
dates: {'20090615': 'Test'},
getData: function(o){
return this.dates[o.date.format('m/d/Y')];
},
// Custom formatting based on date
formatDay: function(o){
var data = this.getData(o);
if (data)
{
o.css += " ux-cal-highlight";
o.caption += "*";
}
},
listeners:
{
// Sample for click handling
click: function(o){
if (o.date)
{
var data = this.getData(o);
alert(o.date.format('m/d/Y'));
}
}
}
});
}
}

Dumas
9 Jan 2011, 10:56 AM
Wrong forum?
You propably wanted to write to the ExtJS 3.0 forum ;)

regards,
Roland