Bonjour à tous,
J'utilise le grid d'ExtJs afin d'afficher mes données récupérées depuis une bd sql server via un web service, le retour des données se fait en format JSON, je suis arrivé a faire afficher mes données sur le grid mais je bloque au niveau de la pagination, je retrouve tout mes enregistrements sur la première page même si j'ai bien spécifié la limite a afficher par page ... je ne vois pas d'où peut venir ce problème surtout que je me suis basé sur la doc officielle, merci de votre aide
Voici mon code :
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
//ExtJs 4
 
Ext.onReady(onReady);
 
function onReady() {
    var itemsPerPage = 10;
    var store = new Ext.data.JsonStore({
        autoLoad: false,
        pageSize: itemsPerPage,
        proxy: new Ext.data.HttpProxy({
            type: 'ajax',
            url: '../Service.asmx/GetMyDvpt',
            reader: {
                type: 'json',
                root: 'd',
                totalProperty: 'total',
                idProperty: 'Id'
            },
            headers: {
                'Content-type': 'application/json'
            }
        }),
        fields: ['NOM_EXP', 'NOM_ESP', 'NOM_VAR', 'SURF_PG', 'DD_CYCLE_PROD']
 
    });
 
    store.load({
        params: {
            start: 0,
            limit: itemsPerPage
        }
    });
 
    Ext.create('Ext.grid.Panel', {
        store: store,
        columns: [
		            { dataIndex: 'NOM_EXP', header: 'NOM_EXP' },
		            { dataIndex: 'NOM_ESP', header: 'NOM_ESP' },
		            { dataIndex: 'NOM_VAR', header: 'NOM_VAR' },
		            { dataIndex: 'SURF_PG', header: 'SURF_PG' },
                    { dataIndex: 'DD_CYCLE_PROD', header: 'DD_CYCLE_PROD', flex: 1 }
		        ],
        renderTo: 'panel',
        title: 'Dvpt Grid',
        width: 570,
        height: 350,
        dockedItems: [{
            xtype: 'pagingtoolbar',
            store: store,
            dock: 'bottom',
            displayInfo: true
        }]
    });
}