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 65 66
|
var monStore;
// FICHIERS GENERIQUES :
Ext.require([
'Ext.data.*',
'Ext.grid.*',
//TEST FILTRES :
'Ext.util.Filter',
]);
// LE MODELE :
Ext.define('monModele',{
extend: 'Ext.data.Model',
fields: ['champ1', 'champ2', 'champ3']
})
// LE STORE :
monStore= Ext.create('Ext.data.Store', {
storeId: 'i_monStore',
model: 'monModele',
proxy: new Ext.data.HttpProxy({
url: 'data/monFichierJson.php',
method: 'GET'
}),
autoLoad: true
});
// LA GRILLE:
var maGrille= Ext.create('Ext.grid.Panel', {
store: monStore,
//TEST FILTRES
//filter : [filters],
columns: [{
id :'champ1',
text : 'Champ 1',
width: '40%',
sortable : true,
dataIndex: 'champ1',
//TEST FILTRES
filterable: true,
filter: {type: 'string'},
},
{
id :'champ2',
text : 'Champ 2',
width: '30%',
sortable : true,
dataIndex: 'champ2',
//TEST FILTRES
filter: true,
}
,
{
id :'champ3',
text : 'Champ 3',
width: '29%',
sortable : true,
dataIndex: 'champ3',
//TEST FILTRES
filter: {type: 'numeric'}
}],
width: '100%',
height: 300,
border: 0
}) |
Partager