I am a new on the Sencha Architect and sencha touch , trying to learn this Framework, I got this example from the internet, I have done all checking on my PHP code and it is working well, What i need to do is As soon as a User is valid i need to send him to another Form, Here is my code on the Login button tap :
But it does not take me to the factForm
var form = button.up('formpanel'), // Login form
values = form.getValues(), // Form values
mainView = this.getMainView(), // Main view
loginPanel = this.getLoginPanel(), // Login and register buttons
// Success
var successCallback = function(resp, ops) {
if(resp.responseText==";OK"){
// Go back
mainView.pop();
// Hide login panel
loginPanel.hide();
var factForm = Ext.create('widget.factform'); // Create Form Factura
mainView.push({
xtype: "factform",
title: "Clientes"
});
}
else{
Ext.Msg.alert("Alerta", resp.responseText);
}
};
// Failure
var failureCallback = function(resp, ops) {
// Show login failure error
Ext.Msg.alert("Login Failure", resp);
};
// TODO: Login using server-side authentication service
Ext.Ajax.request({
url: "http://localhost/DoctorFactura/php/func/chkusr.php",
params: values,
method:"POST",
success: successCallback,
failure: failureCallback
});
But it does not take me to the factForm
var form = button.up('formpanel'), // Login form
values = form.getValues(), // Form values
mainView = this.getMainView(), // Main view
loginPanel = this.getLoginPanel(), // Login and register buttons
// Success
var successCallback = function(resp, ops) {
if(resp.responseText==";OK"){
// Go back
mainView.pop();
// Hide login panel
loginPanel.hide();
var factForm = Ext.create('widget.factform'); // Create Form Factura
mainView.push({
xtype: "factform",
title: "Clientes"
});
}
else{
Ext.Msg.alert("Alerta", resp.responseText);
}
};
// Failure
var failureCallback = function(resp, ops) {
// Show login failure error
Ext.Msg.alert("Login Failure", resp);
};
// TODO: Login using server-side authentication service
Ext.Ajax.request({
url: "http://localhost/DoctorFactura/php/func/chkusr.php",
params: values,
method:"POST",
success: successCallback,
failure: failureCallback
});
Aucun commentaire:
Enregistrer un commentaire