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%"
)]
)

  • del.icio.us
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of Ext common problem of summing up

  • Hibernate connection pool configuration

    Hibernate connection pool configuration <! - Jdbc -> <property name="connection.driver_class"> oracle.jdbc.driver.OracleDriver </ property> <property name="connection.url"> jdbc: oracle: thin: @ 10.203.14.132:15

  • In the servlet use Bean

    According to Sun's definition, JavaBean is a reusable software components. In fact JavaBean is a Java class, through the package into a property and methods of treatment of a function or a business object, referred to as bean. Because JavaBean is ...

  • hibernate to use the principle of

    The use of hibernate, implementation of data persistence. Has the following several processes. One configuration database connection information. Hibernate.config 2 configuration mapping. 3 use: the use of the process are the following steps: 3.1: Ge ...

  • hibernate generic generic DAO

    package org.lzpeng.dao; import java.io.Serializable; import java.util.List; import org.hibernate.Criteria; import org.hibernate.Query; import org.hibernate.criterion.Criterion; import org.springside.modules.orm.hibernate.Page; /** * * @version 2009-1-10 *

  • Struts2 + hibernate + spring problem user log in

    dao layer services layer action jsp <tr> <td align="center"> <b> user name: </ b> </ td> <td> <s: textfield name = "czyNumber" cssClass = "textstyle" theme = "simple" size = &q

  • Based on JDBC, JPA Annotation achieve simple CRUD Generic Dao

    The origin of ideas are pretty long history of reasons: [Use iBATIS history] The use of iBATIS has been a long time, the system is to use the CRUD template tool to generate the code, although there are tools to generate, but looked at a lot of CRUD the Sq

  • Hibernate secondary cache

    Hibernate cache: 2-bit cache, also known as process-level cache or SessionFactory level cache, secondary cache can be shared by all of the session Cache configuration and the use of: Will echcache.xml (the document code in hibernate package directory ...

  • Hibernate's lazy strategy

    hibernate Lazy strategy can be used in: <class> tag, it can be true / false Tags can <PROPERTY> values true / false type of necessary tools to enhance <set> <list> can tag values true / false / extra <many-to-one> <on ...

blog comments powered by Disqus
Recent
Recent Entries
Tag Cloud
Random Entries