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
|
var dataStoreProduit = new Ext.data.Store({
id: 'dataStoreProduit',
proxy: new Ext.data.HttpProxy({
url: 'database.php',
method: 'POST'
}),
baseParams:{task: 'LISTEPRODUITEXISTANT'},
reader: new Ext.data.JsonReader({
root: 'results',
totalProperty: 'total',
id: 'id'
},[
{name: 'IdProduit', type: 'int', mapping: 'IdProduit'},
{name: 'NomProduit', type: 'string', mapping: 'NomProduit'},
{name: 'IdNatureProduit', type: 'int', mapping: 'IdNatureProduit'},
{name: 'NomFabricant', type: 'string', mapping: 'NomFabricant'},
{name: 'NomUsine', type: 'string', mapping: 'NomUsine'}
]),
sortInfo:{field: 'NomProduit', direction: 'ASC'}
});
var cbProduit = new Ext.form.ComboBox({
id: 'cbProduit',
typeAhead: true,
width: $width,
triggerAction: 'all',
allowBlank: true,
store:dataStoreProduit,
mode: 'local',
displayField: 'NomProduit',
valueField: 'IdProduit',
lastQuery: '',
listClass: 'x-combo-list-small'
}); |
Partager