Bug with disable Method & disabled property

  1. #1

    disable Method & disabled property

    Hi,
    There is a problem when I want to Disable my controls on form panel,It seems like a bug to me!
    When I use 'setDisabled' method for my controls, it works completely right.
    example:
    App.textBox1.setDisabled(true);
    App.textBox1.setDisabled(false);
    ,but when I use 'disable' method, It just works when I set it to true!
    example:
    //this one works
    App.textBox1.disable(true);
    //this one doesn't work
    App.textBox1.disable(false);
    ,also when I use 'disabled' property, It totally doesn't work!
    App.textBox1.disabled = true;
    App.textBox1.disabled = false;
    Last edited by nasim; Nov 17, 2015 at 11:11 AM.
  2. #2
    Hi Nasim,

    The parameter of the .disable() method is "silent".
    http://docs.sencha.com/extjs/5.1/5.1...method-disable

    If you pass "false" it doesn't mean a component is going to be enable.

    The .disable() method is only for disabling. It is not supposed to enable a component. There is the .enable() method for that.
    http://docs.sencha.com/extjs/5.1/5.1...-method-enable

    ,also when I use 'disabled' property, It totally doesn't work!
    App.textBox1.disabled = true;
    App.textBox1.disabled = false;
    Yes, just changing a JavaScript property doesn't do the job. Could you, please, clarify why you expect this working or, maybe, share a possible solution how to get it working? Setting a JavaScript property doesn't trigger any additional logic in JavaScript as it could be done in C# via a property's setter.
  3. #3
    ok ! thanks Daniil.
    I thought Javascripts 'disabled' property must have work with Ext Js objects since it is within the possible properties of the object.
    and about enable() and disable() methods,thanks for your explanation, but why there are two way for disabling an object?!
    one way: setDisabled(true/false) and the other disable() + enable() ?
  4. #4
    but why there are two way for disabling an object?!
    one way: setDisabled(true/false) and the other disable() + enable() ?
    I think it is just API completeness. Somebody prefers setDisabled(), someone - disable() and enable(). I guess it also depends on scenarios.
  5. #5
    ok.Thanks Daniil.

Similar Threads

  1. [CLOSED] Button appears as disabled after .disabled = false set
    By registrator in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 28, 2015, 7:55 AM
  2. [CLOSED] [#678] Hyperlink's Disabled property doesn't work well
    By arjunrvasisht in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 04, 2015, 3:13 PM
  3. Replies: 1
    Last Post: Sep 13, 2011, 2:22 PM
  4. Replies: 7
    Last Post: Sep 20, 2010, 10:06 PM
  5. call java script methos on Textarea
    By Sameera in forum 1.x Help
    Replies: 2
    Last Post: Sep 18, 2009, 9:24 AM

Tags for this Thread

Posting Permissions