Hey everyone !
As you see my question, I'm totally new with extjs (and also with Javascript). I'm trying to make a little MVC app, with a PHP server side, using Ext.Direct.
I already find how get the answer (callback) with a formpanel and it "submit" method.
But now I try to call and receive data, after an button click.
Now I want :
Ask data to my server side, and catch the response after I press a button. But I dont' understand how to catch the server response !
There is my code :
Code:
Ext.define('client_app.controller.Header', {
extend: 'Ext.app.Controller'
,views: [ 'Header']
,init: function() {
this.control({
// I add an observer on a button of my view. So when I' click on it,
// "testevent" is called.
'header_menu button[action=dspManageMandate]' :{
click: this.testevent}
});
},
testevent: function(buton, event) {
// I call php method getFrom, in a PHP Form object. the '1' is a parameter
// I can see the JSON answer in my browser console, so the server side works
Ext.app.Form.getForm('1', function(response, e) {
// Problem !!! my app never come there. So How can I catch the server
// response ??
alert('Callback OK. Fn succes :'+ e.statut);
} );
}
});
If some understand why my app never go in my last function, or can explain me how catch the response or any suggestion I will really appreciate.
I'm on it since 3 days, and I really don't know what to do...
(I also post in the Ext.Direct part because I don't know if it's an Ext.Direct problem, or if that's because I don't understand extjs callback function. I will delete 1 of these 2 post when I'll understand my problem)
(Sorry for my bad english
)