0

我想显示一个弹出窗口,其中显示了从 PHP 服务器文件中获取的一些值。我不知道如何在窗口上显示项目。

我不知道为什么,但是当视图被渲染时,控制器中的console.log消息'method call'没有显示出来。我认为这是因为我添加了click: this.methodcall(仅在单击按钮时才调用它,但我希望在呈现视图时打印日志语句)

视图上没有显示任何内容,我认为这是因为我没有添加任何代码来在视图中显示它。

有人可以帮我解决这个问题吗?

我的弹出窗口查看代码;

Ext.define('Project.view.user.Popupwin', {
    extend: 'Ext.window.Window',
    alias: 'widget.popupwin',
    layout:'fit',
    autoShow: true,
    initComponent: function() {
        this.store = 'Popupwin';
        this.items = [
            {
                xtype: 'form',
                items: [                    
                ]
            }
        ];     
        this.callParent(arguments);
    }
});

店铺

Ext.define('Project.store.Popupwin',{
    extend:'Ext.data.Store',
    model:'App.model.Popupwin', 
    proxy: {
        actionMethods : {           
            read   : 'POST'         
        },
        type: 'ajax',
        url : 'loaddata.php',
        autoLoad: true
    }   
});

控制器

Ext.define('Project.controller.Popupwin',{
    extend: 'Ext.app.Controller',       
    stores:['Popupwin'],
    models:['Popupwin'],
    views:['DoctorView'],
    init: function(){
        console.log('executed');                
        this.control({              
            'popupwin': {
                click: this.methodcall
            }
        });             
        },
        methodcall: function() {
                            console.log('method call');
            this.getShowPopupwinStore().load();
        }
});

模型

Ext.define ('Project.model.Popupwin',{
    extend: 'Ext.data.Model',   
    fields:['fname','lanme']
});
4

1 回答 1

3

Window 没有点击事件,所以你不能监听它。

Ext.define('MyWindow', {
    extend: 'Ext.window.Window',
    afterRender: function(){
        this.callParent(arguments);
        this.el.on('click', this.fireClick, this);
    },

    fireClick: function(e, t){
        this.fireEvent('click', this, e);
    }
});
于 2012-07-04T09:01:43.843 回答