Laufwerk
11 Jun 2009, 11:58 PM
Hello !!
I need qhe the user click to dropdown list, throw a query to filling up her store.
I have this code:
customer_nameField = new Ext.form.ComboBox({
id: 'customer_name',
fieldLabel: "Client ",
maxLength: 60,
allowBlank: true,
anchor: '95%',
hidden: false,
hideLabel: false,
// store: new Ext.data.SimpleStore({
// fields: ["id", "description"],
// data : [["nombre1","cif1"],["nombre2","cif2"]]
// }),
displayField: 'id',
valueField: 'id',
mode: 'local',
listeners: {
select:
function(el,type){
customer_codeField.setValue(type.data.cif);
},
expand:
function(el,type){
var myArrayData;
myArrayData = getCustomers();
}
}
});
function getCustomers(){
Ext.Ajax.request({
waitMsg: "Si us plau, esperi...",
url: 'modules/invoices/sections/delivery_notes/include/database.php',
params: {
task: "GETCUSTOMERS",
},
success: function(response){
var result=eval(response.responseText);
switch(result){
case 1:
Ext.utiles.msg("OK", "S'ha desat correctament.");
DataStore.reload();
CreateWindow.close();
break;
default:
Ext.utiles.msg("Atenció", "No s'ha pogut crear.");
break;
}
},
failure: function(response){
var result=response.responseText;
Ext.utiles.msg("Error", "No s'ha pogut connectar amb la base de dades. Intenti-ho més tard");
}
});
}
For the moment the event is correct but ever display me succes - default.
How I can do it?
Anticipated Thanks
Sorry ! This threat is for Ext Comunity Forums (2.0) - Ext: Help
I need qhe the user click to dropdown list, throw a query to filling up her store.
I have this code:
customer_nameField = new Ext.form.ComboBox({
id: 'customer_name',
fieldLabel: "Client ",
maxLength: 60,
allowBlank: true,
anchor: '95%',
hidden: false,
hideLabel: false,
// store: new Ext.data.SimpleStore({
// fields: ["id", "description"],
// data : [["nombre1","cif1"],["nombre2","cif2"]]
// }),
displayField: 'id',
valueField: 'id',
mode: 'local',
listeners: {
select:
function(el,type){
customer_codeField.setValue(type.data.cif);
},
expand:
function(el,type){
var myArrayData;
myArrayData = getCustomers();
}
}
});
function getCustomers(){
Ext.Ajax.request({
waitMsg: "Si us plau, esperi...",
url: 'modules/invoices/sections/delivery_notes/include/database.php',
params: {
task: "GETCUSTOMERS",
},
success: function(response){
var result=eval(response.responseText);
switch(result){
case 1:
Ext.utiles.msg("OK", "S'ha desat correctament.");
DataStore.reload();
CreateWindow.close();
break;
default:
Ext.utiles.msg("Atenció", "No s'ha pogut crear.");
break;
}
},
failure: function(response){
var result=response.responseText;
Ext.utiles.msg("Error", "No s'ha pogut connectar amb la base de dades. Intenti-ho més tard");
}
});
}
For the moment the event is correct but ever display me succes - default.
How I can do it?
Anticipated Thanks
Sorry ! This threat is for Ext Comunity Forums (2.0) - Ext: Help