Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

Threaded View

  1. #1
    Sencha User
    Join Date
    Oct 2012
    Location
    Toulouse
    Posts
    58
    Answers
    7
    Vote Rating
    0
    novadys-sbu is on a distinguished road

      0  

    Default Answered: Passing controller to view problems

    Answered: Passing controller to view problems


    Hello everyone

    So I need a button in my mobile app to download a document.
    My problem is with the binding between my view and my controller.
    It seems that quite a few people have had this problem. Is there any way out ?
    Here is my code :

    In my view I have a button like so
    Code:
    {
                        id: 'downloadButton',
                        xtype: 'button',
                        scope: this,
                        text: 'Download',
                        handler:function(){
                            Ext.Msg.alert("Download button tapped");
                            //CALL CONTROLLER HERE ???
                        }
                        }
    And this is my controller :
    Code:
    Ext.define('documind.controller.DocumentController',{    //Init params
        extend: 'Ext.app.Controller',
        stores: ['Archives'],
        models: ['Viewer'],
        views: ['Viewer'],
        singleton: true,
        alias: 'DocumentController',
        
        /**
        * Main function of the controller
        * It redirects the user event to the corresponding function
        * Created : 30-12-12
        * Author : Sarah Burrell
        */
        init:function(){
             this.control({
                'viewViewer':{
                    downloadButton : this.downloadDocument
                }                
             });
        },
        downloadDocument: function(){
            console.log("Download document");
        } 
        
    });

    If anyone has any ideas I will be very very grateful !!

    Sarah

  2. Because downloadButton is an Ext component so its event can be catched by controller.
    Code:
    {
        id: 'downloadButton',
        xtype: 'button',
        scope: this,
        text: 'Download',
    //  handler:function(){ <- no need
    //      Ext.Msg.alert("Download button tapped");
    //      //CALL CONTROLLER HERE ???
    //  }
    }
    Controller
    Code:
        init:function(){
             this.control({
    //            'viewViewer':{
    //                downloadButton : this.downloadDocument
    //            }
                '#downloadControl': {
                    click: this.downloadDocument
                }
            });
        },

Thread Participants: 1

Tags for this Thread