Hybrid View

  1. #1
    Sencha Premium Member
    Join Date
    Jun 2007
    Location
    Ostrava, Czech Republic
    Posts
    43
    Vote Rating
    2
    ostghost is on a distinguished road

      0  

    Default Unanswered: renderTo and this.control in controller

    Unanswered: renderTo and this.control in controller


    Hi,

    I have dataview with tpl. In controller refresh event of dataview is catched and Ext.form.Panel with textarea and button are added. Till now OK. Controller is subscribed to dynamically added components, so this.reply is called when button click is fired.

    Is there way how to use query widgetpost button[action="reply"] or widgetpost dataview button[action="reply"] ... instead of only button[action="reply"]?

    Component is rendered to DOM and due to this there is probably no "connection" with widgetpost but I don´t want to mess up "global namespace" with common word / buttons actions like reply, send.

    PHP Code:
    // init and set controll
    init:function () {
            
    this.control({
                
    'widgetpost dataview':{
                    
    itemclick:this.itemClickWidgetDataView,
                    
    refresh:this.refresh
                
    },
                
    'button[action="reply"]':{
                    
    click:this.reply
                
    }
            });
        },

    // reply function
    reply: function(me) {
            
    alert(me);
    },

    // refresh function
    refresh:function (me) {
            var 
    renderSelector Ext.query('.commentTextArea');
            for (var 
    i in renderSelector) {
                
    Ext.create('Ext.form.Panel', {
                    
    renderTo:Ext.get(renderSelector[i]),
                    
    border:false,
                    
    layout:{
                        
    type:'hbox'
                    
    },
                    
    items:[
                        {
                            
    xtype:'textarea',
                            
    height:20
                        
    },
                        {
                            
    xtype:'button',
                            
    text:'reply',
                            
    action:'reply'
                        
    }
                    ]
                });
            }
        }, 

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,927
    Answers
    656
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Sure.. you can qualify using your alias name from your view:

    'app-list-users button[action=addUser]' : {
    click : me.addUser
    },
    Scott.

Thread Participants: 1

Tags for this Thread

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