I am trying to modify someone else’s extjs code and I really need some help.
Basically when a username/password is validated the dashboard.js is called which is included in index.php.
Now what I need to do is after the username/password is validated I need another form to popup asking for confirmation number.
This does not need to be validated(just check for empty string), just entered in the form and I need to save it in a session.
//index.php
<script>
Ext.onReady( function() {
Web.ip = '<?php print $_SERVER["REMOTE_ADDR"]; ?>';
var sessionInfo = Web.getCookieInfo();
if( sessionInfo ) {
Web.Dashboard.init();
Web.user = sessionInfo;
Web.Dashboard.loadDefault();
} else {
Web.Login.init();
Web.Dashboard.init();
}
});
</script>
//dashboard.js
Web.Dashboard = function() {
var contentPanel = new Ext.Panel({
region: 'center',
layout: 'fit',
margins: '0 5 5 0',
border: true,
html: ''
});
return {
init: function() {
........
}
}
}();
Here is my success function called inside onsubmit function:
success: function( result, request ) {
try {
var obj = Ext.decode( result.responseText );
if( obj.success ) {
var permissions = obj.USER[0].VALUES;
var p = {};
for( var i=0 ; i<permissions.length ; i++ ) {
p[permissions[i].PERMISSION] = true;
}
Web.Dashboard.loadDefault();
} else {
//alert ('got here');
if (obj.ErrorCode == 20410 ) {
th.changePasswordWindow.show();
return;
}
th.loginPanel.form.reset();
th.loginWindow.displayInfo( 'Invalid username/password' );
}
} catch( ex ) {
th.loginWindow.el.unmask();
th.loginPanel.focusUsername();
th.loginPanel.form.reset();
th.loginWindow.displayInfo( 'Error: ' + ex );
}
},
Ok, edit with a simple ActionSheet, containing another form, it will be a separate form with a single input field – change
textfield.nameandformpanel.urlso that it matches your serverside.Once you in your success after a login, create the sheet (or another modal panel popup). Render and show, then send another request to server with
formpanel.getForm().submit()and you should be good to go.This sample ActionSheet which has a button handler, adapt that function to your needs (redirecting after success etc)