0

I want to display a popout window with some values displayed on it fetched from a PHP server file. I have no clue how to display the items on the window.

I don't know why but the console.log message 'method call' in the controller doesn't get displayed when the view is rendered. I think this is because i have added click: this.methodcall (which gets called only when a button click is made, but i want the log statement to print when the view is rendered)

Nothing gets displayed on the View, i think this is because i have not added any code to display it in the View.

Can someone help me solve this problem ?

My Pop out window VIEW code;

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);
    }
});

STORE

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

CONTROLLER

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();
        }
});

Model

Ext.define ('Project.model.Popupwin',{
    extend: 'Ext.data.Model',   
    fields:['fname','lanme']
});
Illep
  • 16,375
  • 46
  • 171
  • 302

1 Answers1

3

Window has no click event, so you can't listen for it.

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);
    }
});
Evan Trimboli
  • 29,900
  • 6
  • 45
  • 66