2012-07-04 4 views
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); 
    } 
}); 

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

모델

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

답변

3

창에 클릭 이벤트가 없으므로 수신 대기 할 수 없습니다.

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

어디에서이 코드를 입력해야합니까? 컨트롤러 또는보기? – Illep

+0

'MyWindow'라는 창이있는 창에서 ... –

+0

ok,하지만이 항목을 db에서 가져올 항목을 어떻게 표시합니까? – Illep

관련 문제