azmen01
2 Jul 2012, 3:02 AM
Hi, (sorry for my english...)
i have a problem... i hae a function who i get an "ajax" data.... this data i write in an array!!
<<<<this works>>>>
but how i can "alert" this array outside from the "ajax-function"
????
- any ideas -
Ext.define('SaherdData', { singleton: true,
fields: []
});
Ext.Ajax.request({
url: 'benchmark/ajax_getStandorte.php',
success: function (result, request) {
var jsonData = Ext.decode(result.responseText);
for (data in jsonData) {
SaherdData.fields.push(jsonData[data].standort);
}
// HERE IT WORKS!!!!
//alert(SaherdData.fields);
}
});
// AND HERE NOT!!!!
alert(SaherdData.fields);
i have a problem... i hae a function who i get an "ajax" data.... this data i write in an array!!
<<<<this works>>>>
but how i can "alert" this array outside from the "ajax-function"
????
- any ideas -
Ext.define('SaherdData', { singleton: true,
fields: []
});
Ext.Ajax.request({
url: 'benchmark/ajax_getStandorte.php',
success: function (result, request) {
var jsonData = Ext.decode(result.responseText);
for (data in jsonData) {
SaherdData.fields.push(jsonData[data].standort);
}
// HERE IT WORKS!!!!
//alert(SaherdData.fields);
}
});
// AND HERE NOT!!!!
alert(SaherdData.fields);