Ext common problem of summing up

scripts / ext / resources / css / ext-all.css / / EXT generic CSS, contains all the style (must)
scripts / ext / resources / css / icon.css / / custom menu item or other storage page icon
scripts / utils / HiTRUST-CMS.css / / old version of the payment system CSS
scripts / ext / ext-base.js / / the framework of basic library (required)
scripts / ext / ext-all.js / / contains all the EXT library (required)
scripts / ext / ext-lang-zh_CN.js / / EXT prompted all the Chinese (required)
Files Ext order to try at least to the top mark for the JS and CSS must be included in the page, and, please note that the order of import, because of ext-all.js is dependent on the ext-base.js, so ext Import-base.js first, js inside styles are used from the ext-all.css, so the first question into allehanda
1: about the trial (docs.js) tab page can not show, or the prohibition of JS solution to the problem, in the instantiated object autoload, scripts need to set up inside the property, the default is false, that is, loading the tab sub-page, non - implementation of javascript, need to be adjusted into as follows:
A: Var autoLoad = (url: heaf, scripts: true);
Of course, can also be nested An iframe ,
B: html: '<iframe src="+url+" width="100%" height="100%"/>',
In that case, it means that every time load EXT library, but a single page become detachable, coupling reduced

2: about email authentication problem
xtype: 'textfield',
fieldLabel: 'E-mail',
id: 'edit_SPEmail',
name: 'sPEmail',
vtype: 'email', / / this can be verified after adding the EMAIL
anchor:'95% '

3: questions about the use of select
/ / Create JSON data
var statusArray = [
[ 'Normal', 'normal'],
[ 'Written off', 'write-off'],
[ 'Freeze', 'freeze']
];
/ / Use
xtype: 'combo',
store: new Ext.data.SimpleStore ((
fields: [ 'value', 'descp'],
data: statusArray
)),
fieldLabel: 'Status',
loadingText: 'Loading ...',
displayField: 'descp', / / hidden data
valueField: 'value', / / display data
mode: 'local', / / read local data (remote express remote data)
triggerAction: 'all',
id: 'StatusID',
hiddenName: 'StatusName',
editable: true, / / whether you can edit, at the same time this also supports the importation of property search function

4: About text box to enter the basic authentication
allowBlank: false, / / if it is empty, then display a message
minLength: 6, / / at least permit the number of characters
minLengthText: 'Please enter at least 6 characters! ', / / Less than the minimum allowed number of characters, then suggesting that the information
maxLength: 12, / / the maximum allowable number of characters
maxLengthText: 'Please enter up to 50 characters! ', / / More than the maximum allowable number of characters, then suggesting that the information

5: EXT realize how PSOT
Reference code as follows:
buttons: [(
text: 'submit',
handler: function (){// click of a button when the implementation of this function
/ / Verify the validity of
if (win.getComponent ( 'form'). form.isValid ()) (
/ / login as from the id
win.getComponent ( 'form'). form.submit ((
url: 'login_chk.php',
waitTitle: 'tips',
method: 'POST',
waitMsg: 'is log in to verify, please wait ...',
success: function (form, action) (/ / if the successful implementation of post here
var loginResult = action.result.success;
if (loginResult == false) (
/ / Return false if the implementation of login_chk.php here
alert (action.result.message);
) Else if (loginResult == true) (/ / here the successful implementation of
alert (action.result.message);
)
),
failure: function (form, action) (/ / not implemented or POST failure, abnormal return
alert (action.result.message);
)
));
)
)
), (
text: 'Cancel',
handler: function () (simple.form.reset ();}// reset form
)]
Return Backgrounds:
if (authentication success) (
out.print ( "(success: true, message: \" implementation success! \ "}");
) else (
out.print ( "(success: false, message: \" implementation of failure! \ "}");
)
Remarks:
Of course, we can not use this to use POST, can manually obtain the value of AJAX using DWR and other technology, can also achieve, in fact, the principle is the same, are asynchronous call

6: About garbled garbled solution has always been a headache, especially the JS and page, front and back-office interactions between the proposed uniform coding UTF-8, or GBK, can generally be a good solution, if not can realize a filter, and restoration of a unified information request implementation of the consistency of coding, of course, can also manually change the character encoding format, and then manually decode

7: Why do I set up a text box input prompt unlawful, but it should not display prompt text
Ext.QuickTips.init ();// initialize the display when the mouse stay box, support tips tips
/ / Prompt manner enumeration value of "qtip", "title", "under", "side", id (element id)
Ext.form.Field.prototype.msgTarget = 'side';
Qtip: such as the default "qtip" mouse up is automatically displayed
Side: used more, the right appears a red exclamation point, the mouse up an error prompt
Title: similar to an ordinary HTML control inside the property, as title suggests that the mouse hover on the show
Under: displayed on the control of the following and take the initiative to show that the premise does not require a mouse hover, the text box if you do not set up authentication, fails to show

8: EXT realize how like tested?
/ / form verification vType the default type of support
1.alpha / / can only enter letters, can not enter the others (such as the number of special symbols, etc.)
2.alphanum / / can only enter letters and numbers, are not able to enter other
3.email / / email to verify that the requirements are jack_luoting@126.com format
4.url / / url format to verify that the requirements are http://www.skywin.com format

Custom authentication implementation
/ / First way to add custom Ext.apply the password authentication function (you can also check the other's name)
Ext.apply (Ext.form.VTypes, (password: function (val, field) (/ / val here refers to the text box value, field refers to the text box if (field.confirmTo) (/ / confirmTo is our custom configuration parameters are generally used to preserve other components of the id value
var pwd = Ext.get (field.confirmTo); / / obtain confirmTo that the value of id
return (val == pwd.getValue ());// back comparison value
)
return true;
)
));
/ / Configuration parameters items
items: [(fieldLabel: "Password",
id: "pass1",
anchor: "90%"
), (
fieldLabel: "Confirm password"
id: "pass2",
vtype: "password", / / custom authentication types
vtypeText: "Two password prompts inconsistent unlawful !",//
confirmTo: "pass1", / / To compare another component of id
anchor: "90%"
)

9: implementation optional display

Examples of optional fieldset is actually take a chechbox, a bit like part of the Forum registration has the kind of information are optional effect, the main knowledge points:
1.checkboxToggle: true / / true then show a checkbox with the fieldset, select the start, otherwise the other hand, defaults to false
2.checkboxName: string / / When the above is true, as the checkbox of the name, form convenient operation
(
xtype: "fieldset",
checkboxToggle: true, / / key parameters, like the other and previous
checkboxName: "dfdf",
title: "optional information",
defaultType: 'textfield',
width: 330,
autoHeight: true, / / so adaptive to start publishing
items: [(
fieldLabel: "UserName",
name: "user",
anchor: "95%" / / 330px-labelWidth the width of the remaining 95 percent, leaving behind the 5% as mentioned in the verification error
), (
fieldLabel: "PassWord",
inputType: "password", / / password text
name: "pass",
anchor: "95%"
)]
)

分类:AJAX 时间:2009-03-05 人气:725
分享到:
blog comments powered by Disqus

相关文章

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.207 (s). 14 q(s)