Enable or disable the button

  1. #1

    Enable or disable the button



    Hi, guys.

    I have a gridpanel and a number field out of gridpanel, can I enable or disable the number field in server side by using ajax event when one row of gridpanel is selected?
    When I disable a number field in HTML code, I try to use ajax event and recieve the error "Object reference not set to an instance of an object."
    Plz, help me, thanks
  2. #2

    RE: Enable or disable the button

    *Hi,

    I think you will need to post a simple example which shows how to reproduce the JavaScript error.


  3. #3

    RE: Enable or disable the button

    Hi VietView,

    You can disable any Coolite Toolkit form control by setting the .Disabled property to "true". Or, you can use the .Disable() Method.

    Example

    protected void Button1_Click(object sender, AjaxEventArgs e)
    {
        this.NumberField1.Disable();
        
        // or set the .Disabled property
        this.NumberField1.Disabled = true;
    }
    Hope this helps.

    Geoffrey McGill
    Founder
  4. #4

    RE: Enable or disable the button



    hi, how can I disable and enable a button with a client side jscript? I tried to do that jquery way

    $("#button").attr({ disabled: "true" });
    but the above code does not work. I've noticed that coolite generates buttons as html tables (to align graphic stuff) so maybe that's why the jquery approach does not work.
  5. #5

    RE: Enable or disable the button

    Hi blahetal,

    You just use the .setDisabled() JavaScript function, see*http://extjs.com/deploy/dev/docs/?cl...er=setDisabled


    Example


    Button1.setDisabled(true);

    Geoffrey McGill
    Founder

Similar Threads

  1. Replies: 2
    Last Post: Sep 27, 2011, 1:49 PM
  2. Replies: 1
    Last Post: Jul 28, 2011, 4:25 PM
  3. Button Disable/Enable issue
    By paddy in forum 1.x Help
    Replies: 3
    Last Post: Jul 26, 2011, 8:28 AM
  4. Button Enable/Disable
    By Maia in forum 1.x Help
    Replies: 5
    Last Post: Jul 02, 2010, 8:03 PM
  5. how to disable and enable combobox?
    By sadeque in forum 1.x Help
    Replies: 1
    Last Post: Jul 27, 2009, 5:00 AM

Posting Permissions