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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
| Ext.require([
'Ext.grid.*',
'Ext.data.*',
'Ext.util.*',
'Ext.state.*'
]);
function msg() {
alert('toto') // c'est ici que j'aimerais obtenir les valeurs de ma grid modifiée
};
Ext.onReady(function() {
Ext.define('User', {
extend: 'Ext.data.Model',
fields: [ {name : 'CHAMP1'},{name : 'CHAMP2'},{name : 'CHAMP3'}]
});
// create the data store
var userstore = new Ext.data.Store({
id :'monstore',
model:'User',
proxy: {
type : 'ajax',
url: 'creationjson.php',
reader: {
type:'json',
root:'records'
}
},
autoLoad : true
});
// create the Grid
Ext.create('Ext.grid.Panel', {
id : 'montableau',
renderTo : 'tableauordre',
selType: 'cellmodel',
store: userstore,
height: 350,
width: 600,
title: 'tableau',
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
})
],
columns: [
{
text : 'CHAMP1',
dataIndex: 'CHAMP1'
},
{
text : 'champ2',
dataIndex: 'CHAMP2'
},
{
text : 'champ3',
dataIndex: 'CHAMP3',
field :{xtype:'numberfield',
minValue: 1,
maxValue: 999
}
}
],
dockedItems: [{
xtype: 'toolbar',
dock: 'bottom',
ui: 'footer',
layout: {
pack: 'center'
},
items: [{
minWidth: 80,
text: 'Save',
handler: msg
},{
minWidth: 80,
text: 'Cancel'
}]
}]
});
}); |
Partager