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 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
Ext.onReady(function() {
/*
* INITIALIZE
*/
var c_id_selected = '';
var c_name__selected = '';
.
.
.
.
.
var compte_store = new Ext.data.Store({
fields: ['c_id', 'c_name'],
autoLoad: true,
proxy: {
type: 'ajax',
url: global_controller_url + 'get_suppliers',
reader: {
type: 'json',
root: 'data'
}
}
});
// Set Top Bar
var top_bar = [
{
xtype: 'combobox',
fieldLabel: 'Compte',
labelWidth:70,
id: 'frm_sel_compte',
name: 'frm_sel_compte',
store: compte_store,
width:300,
valueField: 'c_id',
displayField: 'c_name',
triggerAction: 'all',
queryMode: 'local',
emptyText: 'Choisir un compte',
enableKeyEvents: true,
forceSelection: true,
editable: false,
listeners: {
select: function(combo,records) {
// console.log("aaaaaaaaaaaaaa");
// console.log(s_id);
// console.log(s_name);
c_id_selected = combo.getValue();
c_name_selected = combo.getRawValue();
alert(c_name_selected);//retourne le nom du compte selectionné
store.reload();
}
}
},
{
xtype: 'button',
text: 'Nouveau',
id: 'btn_receive',
iconCls: 'extjs-icon-add',
iconAlign: 'left',
handler: function() {
New_receiving();
}
},
{
xtype: 'button',
text: 'Supprimer',
id: 'btn_void',
iconCls: 'extjs-icon-cancel',
iconAlign: 'left',
handler: function() {
......
}
},
];
var liste_bar = [
{
....
},
{
xtype: 'text',
text: c_name_selected, // <=========== ne m'affiche pas le nom du compte séléctionné : c_name_selected
id:'idnom',
name:'idnom',
},
{
xtype: 'button',
.
.
.
}
];
var my_grid = new Ext.grid.Panel({
title: 'Choix d',
store: receiving_store,
width: '100%',
height: 500,
columnLines: true,
selModel: receiving_grid_sel_model,
tbar: liste_bar, // appel de la deuxième fenêtre
bbar: bottom_bar,
dockedItems: [{
xtype: 'toolbar',
dock: 'top',
items: [
...
]
}],
columns: [
]
});
}); |
Partager