[Reserved] EXT Detailed core API (h) -Ext.dat-Connection/Ajax/Record javascript
Advertisements
Access to the specified url, this is a class of asynchronous call, if want to get server information is specified in the request parameter or the specified listener callback method (for file upload invalid)
Connection (Object config)
Structure, config is defined as {
autoAbort: Boolean,
defaultHeaders: Object,
disableCaching: Boolean,
extraParams: Object,
method: String,
timeout: Number,
url: String
}
Object
Methods: The methods inherited from the Observable omitted
abort ([Number transactionId]): void
Abandon the request, if there are multiple requests occur simultaneously, the parameter indicates that the request process, serial number, do not specify the last request is to abandon
isLoading ([Number transactionId]): Boolean
The first is finished loading transactionId requests, not approved given that the last
request ([Object options]): Number
Of course, is the most practical method, and returns the previous two methods is needed to process id
Which is defined as {options
url: string, / / request url
params: Object / String / Function, / / method request to post the parameters passed
method: string, / / Get / Post
callback: Function, / / callback method, regardless of success or failure will call this method, there are three parameters, the options parameter passed by the options, success: Boolean, success? response: Object, containing the XMLHttpRequest object to return data
success: Function, / / success callback, the first parameter is XMLHttpRequest object, the second argument to specify the options
failure: Function, / / callback fails, the parameter with the success
scope: Object, / / range
form.: Object / String, / / a form object or its id, which can be automatically generated parameters params
isUpload: Boolean, / / file upload? usually can automatically detect
headers: Object, / / To customize the request headers
xmlData: Object / / a xml document object, it's way through the url additional parameters initiated the request
disableCaching: Boolean / / if disable the cache? default is true
}
Ext.Ajax
Inherited from the Ext.data.Connection, methods, and parent the same, but simpler to use, is a globally unique static class
Example:
Ext.Ajax.request ({
url: 'foo.php',
success: someFn,
failure: otherFn,
headers: {
'My-header': 'foo'
}
params: {foo: 'bar'}
});
Ext.Ajax.request ({
form. 'some-form',
params: 'foo = bar'
});
/ / All requests will Ext.Ajax the first to add a the default
Ext.Ajax.defaultHeaders = {
'Powered-By': 'Ext'
};
/ / All Ext, Ajax will be called prior to the initiation request showSpinner
Ext.Ajax.on ('beforerequest', this.showSpinner, this);
Ext.data.Record
Basically can be understood as. Net sql server in the datarow or a row of data, which stored the data definition information and their value
[Public property]
data: Object data content, a json object
dirty: Boolean whether the modified
id: Object unique ID, the default from the start with a shaved by 1000
modified: Object if the records are not modified, as null if the original value of the modified information is stored
[Public method]
Record (Array data, [Object id])
This construction method is not used to create the record object, on the contrary, you should use create method to create a record object, the parameter data as defined in the create method, id start the default increment id
beginEdit (): void
Start editing
cancelEdit (): void
Abandon the changes made, see commit
copy ([String id]): Record
/ / Create a clone of the current record value, if the id is not specified, the current id +1
commit ([Boolean silent]): void
commit method will generally be called instead of recorde Store object itself, the author self-created or modified the last time all the changes, if silent is true will not notify the store object
create ([Array o]): function
O is the static constructor config array
Config can contain the following properties which
{
name: String / / field name
mapping: String / / mapping for the reader when, if it is used for jsonreader, use the javascript expression relative to the current record
/ /, If it is for the xmlreader, it is relative to the record domquery expression, for ArrayReader, is the number
type: String / / optional value auto / string / int / float / boolean / date, which is the default value of auto, do not convert
sortType: Mixed / / sort type, Ext.data.SortTypes one of the members, see sortTypes
sortDir: String / / positive sequence in reverse order ASC / DESC values
convert: Function / / conversion function, this function is useful, customizable, after receiving the current value of the value returned
dateFormat: String / / date format string, convert: function as a special case, the use of Date.parseDate method to convert the current date
}
endEdit (): void
End modification
get (name {String}): Object
The value of the specified string field named
getChanges (): Object
Return to modify the object record
reject ([Boolean silent]): void
And commit similar, of course, reject the changes made
set (String name, Object value): void
Set new value for the field name value
Related Posts of [Reserved] EXT Detailed core API (h) -Ext.dat-Connection/Ajax/Record javascript
-
Using Rails Captcha plug-in, easy implementation Verification Code
Simple Captcha Plugin Can help us easily in the Rails implementation of Verification Code function. In addition, he has the option to provide sufficient to meet the U.S. requirements for certification, the use of easy. Supported picture and digital authen
-
JS charts extjs implementation tools can be combined
OpenFlashChart brief introduction by valensoft 2009-1-10 8:29:00 OpenFlashChart is an open source Flash and Javascript to the technical foundation for the free chart, using it to create some very useful analysis of the effect of the statements of the char
-
Struts2 Spring Hibernate integration of easy
1. Add Spring 2.0 in Libraries Choose the following four jar, and configure the / WEB-INF/lib under Spring2.0 AOP Libraries Spring2.0 Core Libraries Spring2.0 Persistence Core Libraries Spring2.0 WEb Libraries At the same time, the applicationContext ...
-
Struts2 Spring Hibernate's easy to integrate
1. Add Spring 2.0 in Libraries Choose the following four jar, and configure the / WEB-INF/lib under Spring2.0 AOP Libraries Spring2.0 Core Libraries Spring2.0 Persistence Core Libraries Spring2.0 WEb Libraries At the same time, the applicationContext ...
-
Hibernate Inteceptor
The end of the project stage, the client suddenly put forward a very troublesome but normal demand, the system records all changes must be carried out. Formats such as: 2004.1.1 12:30 Ikuya wind orders Sales Order Date 2004.1.2-> 2004.1.3 The firs ...
-
NoClassDefFoundError: javax / servlet / Servlet
In the project in order to achieve a listener in web.xml set up a listener, did start in Tomcat actually occurred after java.lang.NoClassDefFoundError: javax / servlet / ServletContextListener this anomaly google and found the reasons for the lack of serv
-
Build flex + spring + blazeds + hibernate application
Build flex + spring + blazeds + hibernate application First, set up the project blazeds 1, will blazeds.war extract to a directory, such as: myflex /; 2, set up java works were such as: MyFlex, in the orientation of selection create project from exis ...
-
Ruby on Rails Routing - Simple Examples
This article contains a list of ruby on rails routing examples. If you find you have any questions please leave a comment. Routes are processed from the top of routes.rb down. If a route is matched it will stop processing the routes.rb file and use that r
-
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
-
The EJB3 Persistence
EJB3 persistence with Hibernate is very similar to the mechanism: Environment: Server: JBOSS5.0 Database: MySQL5.0 1. Set up a data source First of all, in jboss-5.0.0.GA \ server \ default \ deploy, the establishment of a database used to connect the dat












