1. #1
    Ext User Stripeman's Avatar
    Join Date
    Apr 2008
    Location
    Heidelberg Germany
    Posts
    275
    Vote Rating
    0
    Stripeman is on a distinguished road

      0  

    Post addClass and onClick

    addClass and onClick


    PHP Code:
    {
                
    id'filter_inactive',
                
    text'Inactive',
                
    iconCls'details',
                
    toggleGroup'filter',
                
    enableToggle:true,
                
    scopethis,
                
    handler: function onItemClick(itemevent) {
                            
                    
    Ext.get('filter_inactive').removeClass('details');
                    
    Ext.get('filter_inactive').addClass('accept');
                    
    dataStore.on('beforeload', function() {
                        
    dataStore.baseParams = {
                                
    'table'     'Members',
                                    
    'ac'      'showData',
                                    
    'page'      'adminMembers'
                                    
    'filter' 'In-Active'
                        
    };
                    });
                    
    dataStore.load();    
                                   
                            }
        
                        } 
    What I am doing wrong?
    Ext.get('filter_inactive').removeClass('details');
    Ext.get('filter_inactive').addClass('accept');

    Just does not work and no errors are returned.

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

      -1  

    Default


    Define "not work"

    You've stepped through it, and the Element with id "filter_inactive" does not have its class manipulated?

  3. #3
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,080
    Vote Rating
    113
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    You are removing the CSS class from the wrapping element around this component.

    Take a look at what element in the markup the original iconCls 'details' is applied to. This is the element that you will want to remove the class from. You may also be interested in Ext.Element's replaceClass method.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  4. #4
    Ext User Stripeman's Avatar
    Join Date
    Apr 2008
    Location
    Heidelberg Germany
    Posts
    275
    Vote Rating
    0
    Stripeman is on a distinguished road

      0  

    Default


    Quote Originally Posted by Animal View Post
    Define "not work"

    You've stepped through it, and the Element with id "filter_inactive" does not have its class manipulated?
    Thats correct. The before and after are the same lol

    I am trying to make an indicator on the button clicked (glass green dot or something) and removing the iconCls from the others.

  5. #5
    Ext User Stripeman's Avatar
    Join Date
    Apr 2008
    Location
    Heidelberg Germany
    Posts
    275
    Vote Rating
    0
    Stripeman is on a distinguished road

      0  

    Default


    Quote Originally Posted by aconran View Post
    You are removing the CSS class from the wrapping element around this component.
    oh ? Because I thought that the Ext.getCmp() (or get() ) was giving the THE component. I am trying to manipulate the component directly. That component lies inside a xtype buttongroup do i need to start there?

    Quote Originally Posted by aconran View Post
    Take a look at what element in the markup the original iconCls 'details' is applied to. This is the element that you will want to remove the class from.
    Iam not sure if I am following. element in the markup the original is applied to? Im pretty sure you are not talkinga bout the css but the ID that I am trying to manipulte. (?) the element 'filter_inactive' is the element and I thought I was pointing the manipulation right to it.

    Quote Originally Posted by aconran View Post
    You may also be interested in Ext.Element's replaceClass method.
    I will look that up.

  6. #6
    Ext User Stripeman's Avatar
    Join Date
    Apr 2008
    Location
    Heidelberg Germany
    Posts
    275
    Vote Rating
    0
    Stripeman is on a distinguished road

      0  

    Default


    This worked:
    Ext.getCmp('filter_inactive').setIconClass('accept');

    I dont understand why neither removeClass and replaceClass worked

    BTW .. I am using 3.x

    PHP Code:
    {
                
    id'filter_inactive',
                
    text'Inactive',
                
    iconCls'details',
                
    toggleGroup'filter',
                
    enableToggle:true,
                
    scopethis,
                
    handler: function onItemClick(itemevent) {
                            
                   
    // This worked just fine...
                   
    Ext.getCmp('filter_inactive').setIconClass('accept');  //selected
                   
    Ext.getCmp('filter_none').setIconClass('details');      //not selected

                    
    dataStore.on('beforeload', function() {
                        
    dataStore.baseParams = {
                                
    'table'     'Members',
                                    
    'ac'      'showData',
                                    
    'page'      'adminMembers'
                                    
    'filter' 'In-Active'
                        
    };
                    });
                    
    dataStore.load();    
                                   
                            }
        
                        } 

  7. #7
    Ext User Stripeman's Avatar
    Join Date
    Apr 2008
    Location
    Heidelberg Germany
    Posts
    275
    Vote Rating
    0
    Stripeman is on a distinguished road

      0  

    Default


    question though.. can you please tell me where i can find a list of functions for "Ext.getCmp"? I did look in the doco and cant find it... it is possible i am blind...

  8. #8
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,656
    Vote Rating
    6
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  9. #9
    Ext User Stripeman's Avatar
    Join Date
    Apr 2008
    Location
    Heidelberg Germany
    Posts
    275
    Vote Rating
    0
    Stripeman is on a distinguished road

      0  

    Default


    Quote Originally Posted by steffenk View Post
    Thanks much Steffenk.. but as stated, I am looking for a list of functions for Ext.getCmp

    IE:
    Ext.getCmp(element).setIconClass() etc

  10. #10
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,656
    Vote Rating
    6
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    what you get is Ext.Component which is described here
    http://extjs.com/deploy/dev/docs/?class=Ext.Component
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5