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,637
    Answers
    613
    Vote Rating
    400
    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

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar