Bonjour à tous,
j'ai une Grid Infiny avec une pagination de 50. J'ai 2 champs dans mon model (Form et Frequency)
Mon problème est le suivante:
- lors du premier remplissage de ma grille, mes checkboxes fonctionnent parfaitement, mais si je ferme ma
vue puis la ré-ouvre alors mes checkboxes ne sont plus "checkable", je suppose que je dois mal définir quelque chose
ou alors mal vider mon store....
Mes checkboxes lors de la ré-ouverture ne semblent pas être grisé, ils sont juste inertes. Et mes données sont bien affichées.
Ma infinite grid fonctionne très bien lors de la première ouverture de ma vue.
Je fais mon remplissage dans le BeforeRender de ma vue (depuis le controller)
Auriez vous une idée ?
Je n'ai aucune erreur dans ma console.
Pensez vous que ma manière de vider la grille est bonne au démarrage, car j'ai vu qu'il y avait plusieurs méthodes.
D'avance merci pour vos aides et conseils....
ci-dessous vous trouverez: model, store, view, controller
MODEL
STORE
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 Ext.define('PP.model.chart.GridLeftGraphic', { extend: 'Ext.data.Model', fields: [ { type: 'string', name: 'name' }, { type: 'int', name: 'f' } ] });
VIEW
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 Ext.define('PP.store.chart.GridLeftGraphics', { extend : 'Ext.data.Store', model : 'PatentPulse.model.chart.GridLeftGraphic', storeId : 'storeGridLeftGraphic', clearOnLoad : true, autoLoad : false, remoteSort : true, // allow the grid to interact with the paging scroller by buffering buffered : true, leadingBufferZone : 10, // The number of records to keep rendered below the visible area. trailingBufferZone : 10, // The number of records to keep rendered above the visible area. numFromEdge : 5, // How close the edge of the table should come to the visible area before the table is refreshed further down. pageSize : 50, purgePageCount : 0, proxy: { // load using script tags for cross domain, if the data in on the same domain as // this page, an HttpProxy would be better type : 'jsonp', limitParam : 'rows', pageParam : 'start', reader: { //type : 'jsonp', totalProperty : 'total', // si omit alors totalProperty prend aussi la valeur "total" messageProperty : 'message', successProperty : 'success', root : 'rows' }, listeners : { exception : function(proxy, response, operation) { //exception handling alert('Exception in store/chart/GridLeftGraphics'); } }, // sends single sort as multi parameter simpleSortMode : true }, sorters: [{ property : 'pd', direction: 'DESC' }] });
CONTROLLER
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 { title : 'Select forms', xtype : 'grid', itemId : 'mygridleftgraphic', id : 'mygridleftgraphic', store : 'PP.store.chart.GridLeftGraphics', frame : false, margin : '0 0 0 0', region : 'center', collapsible : false, collapsed : false, hideCollapseTool : false, columnLines : true, multiSelect : true, selType : 'rowmodel', verticalScrollerType : 'paginggridscroller', invalidateScrollerOnRefresh : false, viewConfig: { stripeRows : true, emptyText : 'No Record Found', deferEmptyText : false, forceFit : true }, columns: [ { text: 'Name', flex: 1, sortable: true, dataIndex: 'name' }, { text: 'F.', width: 40, sortable: true, dataIndex: 'f'} ], selModel: Ext.create('Ext.selection.CheckboxModel', { checkOnly: true //false = select from anywhere on row } ) }
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 onBeforeRender: function() { // Mes variables sont définies ici mais j'ai virer le code pour afficher moins de ligne // Je vide le store de la Grille FORMS var myGridLeftGraphic = this.getRefGridLeftGraphic(); var storeGLG = myGridLeftGraphic.getStore(); storeGLG.removeAll(); storeGLG.on('beforeload', function(store, options) { store.getProxy().url = 'data/chart/getfreq.php'; store.getProxy().extraParams = { // Param pour MySQL cid : myCid, lid : myLid, jsonid : myId, // Param pour info multivalue : 1, isdate : 0, is4digit : 0, // Param pour SOLR q : CurrentQuery, fl : 'ap', facet : (CurrentFacet!=='') ? 'true' : 'false', fq : CurrentFacet }; }, this ); storeGLG.load({ scope : this, params : {}, callback: function(records, operation, success) { if (success) {} } }); },
Partager