1. #1
    Ext User
    Join Date
    Jun 2010
    Posts
    3
    Vote Rating
    0
    felipefmelo is on a distinguished road

      0  

    Default 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

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,499
    Vote Rating
    47
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    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.

  3. #3
    Sencha User
    Join Date
    Sep 2009
    Location
    Calgary, Alberta, Canada
    Posts
    638
    Vote Rating
    2
    CrazyEnigma is on a distinguished road

      0  

    Default


    Try setDisabled(<boolean value>)

  4. #4
    Ext User
    Join Date
    Jun 2010
    Posts
    3
    Vote Rating
    0
    felipefmelo is on a distinguished road

      0  

    Default


    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:
    Code:
    <asp:TextBox ID="txtCalendar" runat="server" rel="calendar"></asp:TextBox>
    JS file:
    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  
            });  
        });
    });
    Code:
    var myDateField = Ext.get("txtCalendar");
    myDateField.disable();
    CrazyEnigma
    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

  5. #5
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,499
    Vote Rating
    47
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    It's absolutely fundamental that you learn the difference between Ext.get and Ext.getCmp

  6. #6
    Ext User
    Join Date
    Jun 2010
    Posts
    3
    Vote Rating
    0
    felipefmelo is on a distinguished road

      0  

    Default


    My mistake. I told you I was a newbie. heheh
    Now it's working fine! Thanks a lot!
    FFM

Similar Threads

  1. Checkbox enable/disable
    By Brad2009 in forum Ext 2.x: Help & Discussion
    Replies: 10
    Last Post: 5 Jan 2009, 11:07 AM
  2. enable/disable
    By yade in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 9 Aug 2008, 2:09 AM
  3. Enable then disable a field
    By captainm1uk in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 26 Nov 2007, 2:12 PM

Thread Participants: 2

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi