ExtJS 4 MVC multiple instances of views and sub/child controller difficulties

前端 未结 7 993
情书的邮戳
情书的邮戳 2021-02-07 13:01

I have encountered a problem with the MVC pattern in ExtJS 4. At least, I think I have. Having approached multiple people with this question, and having posted numerous times in

7条回答
  •  有刺的猬
    2021-02-07 14:00

    Of course. What led you to believe otherwise? Here is an example of creating a custom View which extends from a Window component. You can run this method many times from the same controller and each time you will get a new instance of a View.

    "this" refers to a controller that code runs in:

           this.getRequestModel().load(requestID,{       //load from server (async)
                     success: function(record, operation) {
                            var view = Ext.widget('requestEdit',{
                                title: 'MyRequest '+requestID
                            });
                            var form = view.down('form');
                            form.loadRecord(record);
                     }
             });
    

提交回复
热议问题