0
我想修改別人的extjs代碼,我真的需要一些幫助。extjs登錄後顯示確認表格
基本上,當驗證用戶名/密碼時,將調用dashboard.js,它包含在index.php中。 現在我需要做的是在驗證用戶名/密碼後,我需要另一個表單彈出詢問確認號碼。 這不需要驗證(只需檢查空字符串),只需在窗體中輸入,我需要將它保存在會話中。
//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() {
........
}
}
}();
這裏被稱爲我的成功函數的onsubmit函數內:
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);
}
},
感謝mschr(成功後等重定向),我不知道如何將其納入我的成功函數內。看我的編輯.. – Micheal 2012-07-17 18:32:58