Bonjour,
Je rencontre encore un problème.
Pour tester j'ai utilisé ExtJS Designer pour construire un tableau (grid) et mettre en place la pagination.
Mon problèm est que je ne sais pas comment passer les paramètres "start" et "limit" dans le système construit par ExtDesigner.
Si l'un d'entre avait une petite idée, je vous donne les codes généré par le designer.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 /* * File: MyGrid.js * You should implement event handling and custom methods in this * class. */ MyGrid = Ext.extend(MyGridUi, { initComponent: function() { MyGrid.superclass.initComponent.call(this); } });
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64 /* * File: MyGrid.ui.js * Do NOT hand edit this file. */ MyGridUi = Ext.extend(Ext.grid.GridPanel, { title: 'My Grid', store: 'dataStore', width: 762, height: 483, initComponent: function() { this.bbar = { xtype: 'paging', pageSize: 20, store: 'dataStore', displayInfo: true }; this.columns = [ { xtype: 'gridcolumn', header: 'Description', dataIndex: 'description', sortable: true, width: 100 }, { xtype: 'gridcolumn', header: 'Nom', dataIndex: 'nom', sortable: true, width: 100 }, { xtype: 'gridcolumn', header: 'Résumé', dataIndex: 'resume', sortable: true, width: 100 }, { xtype: 'gridcolumn', header: 'Version', dataIndex: 'version', sortable: true, width: 100 }, { xtype: 'datecolumn', header: 'Date', dataIndex: 'date', sortable: true, width: 100 }, { xtype: 'gridcolumn', header: 'Application', dataIndex: application', sortable: true, width: 100 } ]; MyGridUi.superclass.initComponent.call(this); } });Merci par avance de vos réponses ^^
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
47
48
49
50
51
52 /* * File: MyStore.js * Do NOT hand edit this file. */ MyStore = Ext.extend(Ext.data.JsonStore, { constructor: function(cfg) { cfg = cfg || {}; MyStore.superclass.constructor.call(this, Ext.apply({ storeId: 'dataStore', url: 'php/aaa.php', idProperty: 'ID', totalProperty: 'totalCount', root: 'results', autoLoad: true, autoDestroy: true, sortField: 'commentaire', paramNames: { start: 0, limit: 20 }, fields: [ { name: 'description', mapping: 'DESCRIPTION' }, { name: 'nom', mapping: 'NAME' }, { name: 'resume', mapping: 'RESUME' }, { name: 'version', mapping: 'VERSION' }, { name: 'date', mapping: 'CREATION_TIME', type: 'date' }, { name: 'application', mapping: 'APPS' } ] }, cfg)); } }); new MyStore();
Partager