Results 1 to 4 of 4

Thread: Disable grid CRUD buttons based upon return from function

  1. #1
    Sencha User
    Join Date
    Jan 2015
    Posts
    3
    Vote Rating
    0
      0  

    Default Disable grid CRUD buttons based upon return from function

    I'm having trouble figuring out how to disable or hide the add, edit and delete buttons in my grid. I have a security check to determine whether a user has CRUD abilities. This is what I have in my grid's onFileGridRender. I've tried all these different ways to hide or disable it, but none has worked. Thanks for any help you can give.

    Ext.Ajax.request({
    url: '/valence/vvcall.pgm',
    params: {
    pgm: 'CX0028',
    action: 'CheckAuthorization',
    },
    success: function(response, opts) {
    var obj = Ext.decode(response.responseText);
    if (response.responseText == '{"success":false}') {
    Ext.Msg.alert('Return Status', response.responseText);
    //Ext.get('addbutton').setVisible(false);
    //Ext.container.Container.getComponent('#addbutton').Disabled(true);
    //Ext.ComponentQuery.query('#Addbutton')[0].hidden=true;
    //Ext.ComponentQuery.query('#Addbutton')[0].hide();
    //Ext.ComponentQuery.query('Addbutton')[0].hidden=true;
    //Ext.ComponentQuery.query('Addbutton')[0].hide();
    //Ext.ComponentQuery.query('Addbutton').hidden=true;
    //Ext.ComponentQuery.query('Addbutton').hide();
    addbutton.Disabled(true);
    }}
    });

  2. #2
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579
    Vote Rating
    77
      0  

    Default

    Take a look at this method for disabling a Button component: http://docs.sencha.com/extjs/3.4.0/#...method-disable
    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

  3. #3
    Sencha User
    Join Date
    Jan 2015
    Posts
    3
    Vote Rating
    0
      0  

    Default

    I tried Ext.Button('#addbutton').Disabled(true); and Ext.Button('addbutton').Disabled(true); Button still enabled. How about an actual example?

  4. #4
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579
    Vote Rating
    77
      0  

    Default

    I'm not sure where you are pulling the Disabled method from. The link I provided to the API points to disable();

    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

Similar Threads

  1. Replies: 5
    Last Post: 30 Oct 2015, 6:07 AM
  2. Replies: 5
    Last Post: 12 Sep 2011, 11:31 AM
  3. How to disable single grid cell based on its content
    By adrin in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 12 Jan 2011, 5:25 AM
  4. Ext Based CRUD for Blueoxygen
    By flatburger in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 2 Aug 2008, 10:18 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •