Sencha Documentation

Properties

 
apply : Object
 
apply : Object
 
if : string
This property is deprecated. Please use Ext.getVersion(packageName) instead. For example: var coreVersion = Ext.getVe...
This property is deprecated. Please use Ext.getVersion(packageName) instead. For example:
var coreVersion = Ext.getVersion('core');

Methods

 
compare( String current, String target ) : Number
Compare 2 specified versions, starting from left to right. If a part contains special version strings, they are handl...
Compare 2 specified versions, starting from left to right. If a part contains special version strings, they are handled in the following order: 'dev' < 'alpha' = 'a' < 'beta' = 'b' < 'RC' = 'rc' < '#' < 'pl' = 'p' < 'anything else'

Parameters

  • current : String
    The current version to compare to
  • target : String
    The target version to compare to

Returns

  • Number   Returns -1 if the current version is smaller than the target version, 1 if greater, and 0 if they're equivalent
 
constructor( String/Number version ) : Ext.Version
A utility class that wrap around a string version number and provide convenient method to do comparison. See also: co...
A utility class that wrap around a string version number and provide convenient method to do comparison. See also: compare. Example:
var version = new Ext.Version('1.0.2beta');
console.log("Version is " + version); // Version is 1.0.2beta
console.log(version.getMajor()); // 1
console.log(version.getMinor()); // 0
console.log(version.getPatch()); // 2
console.log(version.getBuild()); // 0
console.log(version.getRelease()); // beta
console.log(version.gt('1.0.1')); // True
console.log(version.gt('1.0.2alpha')); // True
console.log(version.gt('1.0.2RC')); // False
console.log(version.gt('1.0.2')); // False
console.log(version.match(1.0)); // True
console.log(version.match('1.0.2')); // True

Parameters

  • version : String/Number
    The version number in the follow standard format: major[.minor[.patch[.build[release]]]] Examples: 1.0 or 1.2.3beta or 1.2.3.4RC

Returns

  • Ext.Version   this
 
deprecate( String packageName, String since, Function closure, Object scope ) : Void
Create a closure for deprecated code. Note that for max performance, this will be stripped out automatically when bei...
Create a closure for deprecated code. Note that for max performance, this will be stripped out automatically when being built with JSBuilder

Parameters

  • packageName : String
    The package name
  • since : String
    The last version before it's deprecated
  • closure : Function
    The callback function to be executed with the specified version is less than the current version
  • scope : Object
    The execution scope (this) if the closure

Returns

  • Void
 
eq( String/Number target ) : Boolean
Convenient shortcut for equals
Convenient shortcut for equals

Parameters

  • target : String/Number
    The version to compare with

Returns

  • Boolean   True fs this version equals to the target, false otherwise
 
equals( String/Number target ) : Boolean
Returns whether this version equals to the supplied argument
Returns whether this version equals to the supplied argument

Parameters

  • target : String/Number
    The version to compare with

Returns

  • Boolean   True if this version equals to the target, false otherwise
 
getBuild : Number
Returns the build component value
Returns the build component value
 
getComponentValue( Mixed value ) : Mixed
Converts a version component to a comparable value
Converts a version component to a comparable value

Parameters

  • value : Mixed
    The value to convert

Returns

  • Mixed   undefined
 
getMajor : Number
Returns the major component value
Returns the major component value
 
getMinor : Number
Returns the minor component value
Returns the minor component value
 
getPatch : Number
Returns the patch component value
Returns the patch component value
 
getRelease : Number
Returns the release component value
Returns the release component value
 
getSimplified : String
Returns simplified version without dots and release
Returns simplified version without dots and release
 
getVersion( String packageName ) : Ext.Version
Get the version number of the supplied package name
Get the version number of the supplied package name

Parameters

  • packageName : String
    The package name, for example: 'core', 'touch', 'extjs'

Returns

  • Ext.Version   The version
 
gt( String/Number target ) : Boolean
Convenient shortcut for isGreaterThan
Convenient shortcut for isGreaterThan

Parameters

  • target : String/Number
    The version to compare with

Returns

  • Boolean   True if this version if greater than the target, false otherwise
 
isGreaterThan( String/Number target ) : Boolean
Returns whether this version if greater than the supplied argument
Returns whether this version if greater than the supplied argument

Parameters

  • target : String/Number
    The version to compare with

Returns

  • Boolean   True if this version if greater than the target, false otherwise
 
isSmallerThan( String/Number target ) : Boolean
Returns whether this version if smaller than the supplied argument
Returns whether this version if smaller than the supplied argument

Parameters

  • target : String/Number
    The version to compare with

Returns

  • Boolean   True if this version if smaller than the target, false otherwise
 
iterate : Void
This method is deprecated. Please use Ext.each instead. It's now a wrapper for both Ext.Array.each and Ext.Object.eac...
This method is deprecated. Please use Ext.each instead. It's now a wrapper for both Ext.Array.each and Ext.Object.each
 
lt( String/Number target ) : Boolean
Convenient shortcut for isSmallerThan
Convenient shortcut for isSmallerThan

Parameters

  • target : String/Number
    The version to compare with

Returns

  • Boolean   True if this version if smaller than the target, false otherwise
 
match( String/Number target ) : Boolean
Returns whether this version matches the supplied argument. Example: var version = new Ext.Version('1.0.2beta'); cons...
Returns whether this version matches the supplied argument. Example:
var version = new Ext.Version('1.0.2beta');
console.log(version.match(1)); // True
console.log(version.match(1.0)); // True
console.log(version.match('1.0.2')); // True
console.log(version.match('1.0.2RC')); // False

Parameters

  • target : String/Number
    The version to compare with

Returns

  • Boolean   True if this version matches the target, false otherwise
 
setVersion( String packageName, String version ) : Ext
Set version number of the supplied package name. Note: This is not meant to be called from the application-level, onl...
Set version number of the supplied package name. Note: This is not meant to be called from the application-level, only from framework-level

Parameters

  • packageName : String
    The package name, for example: 'core', 'touch', 'extjs'
  • version : String
    The version, for example: '1.2.3alpha', '2.4.0-dev'

Returns

  • Ext   undefined
 
toArray : Array
Returns this format: [major, minor, patch, build, release]. Useful for comparison
Returns this format: [major, minor, patch, build, release]. Useful for comparison