1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    21
    Answers
    2
    Vote Rating
    0
    whisher is on a distinguished road

      0  

    Default Answered: MVC add click event on the icon add form the controller

    Answered: MVC add click event on the icon add form the controller


    Hi,
    PHP Code:
    Ext.define('SA.view.user.List' ,{
        
    extend'Ext.grid.Panel',
        
    alias 'widget.userlist',
        
    title 'All Users',
        
    store'Users',
        
    initComponent: function() {
           
            
    this.columns = [
                {
                    
    header'Id',
                    
    sortabletrue,
                    
    dataIndex'id',
                    
    flex1,
                    
    field: {
                        
    type'textfield'
                    
    }
                },
                {
                    
    header'Name',
                    
    sortabletrue,
                    
    dataIndex'uname',
                    
    flex1,
                    
    field: {
                        
    type'textfield'
                    
    }
                },
                {
                    
    header'Email',
                    
    sortabletrue,
                    
    dataIndex'email',
                    
    flex1,
                    
    field: {
                        
    type'textfield'
                    
    }
                }
            ];

            
    this.callParent(arguments);
        },

        
    dockedItems: [
            {
                    
    xtype'toolbar',
                    
    items: [{
                        
    iconCls'icon-add',
                        
    text'Add',
                        
    scopethis
                       
                    
    }, {
                        
    iconCls'icon-delete',
                        
    text'Delete',
                        
    disabledtrue,
                        
    itemId'delete',
                        
    scopethis
                       
                    
    }]
                },
            {
                
    xtype'pagingtoolbar',
                
    store'Users',   // same store GridPanel is using
                
    dock'bottom',
                
    displayInfotrue
            
    }
        ]
    }); 
    I've added a simple add delete toolbar to my grid but how
    I can add an event listener to my controller - controll for
    the add button ?

    PHP Code:
    init: function() {
            
    this.control({
                
    'userlist': {
                    
    itemdblclickthis.editUser
                
    },
                
    'userlist > toolbar/*my attempt but it doesnt work :( */': {
                    
    clickthis.insertUser
                
    },
                
    'useredit button[action=save]': {
                    
    clickthis.updateUser
                
    }
            });
        }, 

  2. I've added an id
    PHP Code:
    items: [{
                        
    iconCls'icon-add',
                        
    id'b-add',
                        
    text'Add',
                        
    scopethis
                       
                    

    and than simply

    PHP Code:
    'userlist > toolbar > button#b-add': {
                    
    clickthis.insertUser
                

    Thanks the same

  3. #2
    Sencha User
    Join Date
    Nov 2011
    Posts
    21
    Answers
    2
    Vote Rating
    0
    whisher is on a distinguished road

      0  

    Default


    I've added an id
    PHP Code:
    items: [{
                        
    iconCls'icon-add',
                        
    id'b-add',
                        
    text'Add',
                        
    scopethis
                       
                    

    and than simply

    PHP Code:
    'userlist > toolbar > button#b-add': {
                    
    clickthis.insertUser
                

    Thanks the same

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi