Hybrid View
-
24 Jun 2010 6:01 AM #1
How to enable/disable a DateField
How to enable/disable a DateField
Hi,
I need to enable/disable a DateField everytime a dropdownlist changes its value.
I'm trying to call myDateField.disable() method, but it isn't working.
I'm using version 3.2.1 and this method is listed in documentation (http://www.sencha.com/deploy/dev/doc...form.DateField).
According to the error message in Firebug, the Method doesn't exists (myDateField.disable is not a function).
As I'm new to ExtJS, can anyone help me with this?
Thanks a lot.
FFM
-
24 Jun 2010 7:04 AM #2
I'd guess that your var myDateField is not referencing what you hope it is referencing.
But since we see no code, it's impossible to help further.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
24 Jun 2010 7:28 AM #3
Try setDisabled(<boolean value>)
-
24 Jun 2010 8:38 AM #4
Animal,
Sorry, you are right. I'm using ExtJS with ASP.NET.
Every TextBox with attribute rel="calendar" will be transformed in a DateField control.
For now, it's just a simple test page.
Here is some code:
ASPX file:
JS file:Code:<asp:TextBox ID="txtCalendar" runat="server" rel="calendar"></asp:TextBox>
Code:Ext.onReady(function(){ var textBoxes = Ext.DomQuery.select("input[rel=calendar]"); Ext.each(textBoxes, function(item, id, all){ var cl = new Ext.form.DateField({ format: "d/m/Y", width: 95, applyTo: item }); }); });CrazyEnigmaCode:var myDateField = Ext.get("txtCalendar"); myDateField.disable();
I've tried also use myDateField = Ext.get("txtCalendar").dom and myDateField.setDisabled(true);.
As i said, I'm new to ExtJS, so, I'm not sure if I've done everything the right way.
Thank you again.
FFM
-
24 Jun 2010 9:31 AM #5
It's absolutely fundamental that you learn the difference between Ext.get and Ext.getCmp
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
24 Jun 2010 10:01 AM #6
My mistake. I told you I was a newbie. heheh
Now it's working fine! Thanks a lot!
FFM
Similar Threads
-
Checkbox enable/disable
By Brad2009 in forum Ext 2.x: Help & DiscussionReplies: 10Last Post: 5 Jan 2009, 11:07 AM -
enable/disable
By yade in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 9 Aug 2008, 2:09 AM -
Enable then disable a field
By captainm1uk in forum Ext 1.x: Help & DiscussionReplies: 2Last Post: 26 Nov 2007, 2:12 PM


Reply With Quote