Results 1 to 3 of 3

Thread: Immitation button click after store load

  1. #1
    Sencha User
    Join Date
    Dec 2009
    Posts
    8

    Default Immitation button click after store load

    Pls, help me ))
    I can not add an event simulating a click

    PHP Code:
    var chart = new Ext.Panel({        
    height:200,        
    layout:'fit',        
    margins'5 5 0',        
    region:'north',        
    splittrue,        
    minHeight100,        
    maxHeight500,        
    titleLANG['chart_panel'],        
    collapsibletrue,        
    iconCls'icon-chart',        
    bbar: ['<b>See: </b>','-',{
                
    text'All',
                
    id'btnall',
                
    handler: function(){
                    
    Gstore.clearFilter('year');
                    
    cstore.refreshData();
                }
    }]}); 
    PHP Code:
    userGrid.store.on('load'Ext.get('btnall').clickuserGrid); 
    Cannot read property 'click' of null

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791
    Answers
    585

    Default

    Trying to force the event is the wrong way to do this. Move the relevant logic to a method then call the method from both the handler and the load callback.

  3. #3
    Sencha User
    Join Date
    Dec 2009
    Posts
    8

    Default

    Solved the problem by adding a listener to the Store:


    PHP Code:
            listeners: {
                
    load: {
                    
    fn: function ( { 
                        
    Gstore.clearFilter('year');
                        
    cstore.refreshData();
                    }
                }
            } 

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
  •