Bonjour,
J'essaie de réaliser un exemple sur le model MVC de extjs version 4.2.1, la stucture de mon application est :
Cet exemple sert à afficher un grid simple :
Mes fichiers :
controller/Employe
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 Ext.define('MVC.controller.Employes',{ extend: 'Ext.app.Controller', views : [ 'employe.List', 'employe.Edit' ], init: function(){ this.control({ 'employelist' : { itemdblclick: this.editEmploye } }); }, editEmploye: function( grid,record ) { //console.log('Double click sur Employe ' + record.get('nom')); var view = Ext.widget('employeedit'); view.down('form').loadRecord(record); // <--- ERROR : Uncaught TypeError: win.down is not a function } });
view/employe/List
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 Ext.define('MVC.view.employe.List',{ extend: 'Ext.grid.Panel', alias: 'widget.employelist', title: 'Tous les Employes', initComponent : function(){ this.store = { fields : ['nom','email'], data : [ {nom:'Abidou', email: 'oabidou@gmail.com'}, {nom:'Rahima', email: 'rama_nf@hormail.com'} ] }; this.columns = [ {header:'Nom', dataIndex:'nom', flex:1}, {header:'Email', dataIndex:'email', flex:1} ]; this.callParent(arguments); } });view/employe/EditUn message d'erreur s'affiche lorsque je double clique sur un enregistrement :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46 Ext.define('MVC.view.employe.Edit',{ extned: 'Ext.window.Window', alias: 'widget.employeedit', layout: 'fit', autoShow: true, initComponent: function(){ this.items = [ { xtype : 'form', items: [ { xtype:'textfield', name: 'nom', fieldLabel: 'Nom' }, { xtype:'textfield', name: 'email', fieldLabel: 'Email' } ] } ]; this.buttons = [ { text: 'Enregistrer', action: 'enregistrer' }, { text: 'Annuler', scope: this, handler: this.close } ]; } });
Uncaught TypeError: win.down is not a function
voir la ligne 19 du fichier controller/Employe
Merci pour votre aide .
Partager