Ext.Version

Files

A utility class that wrap around a string version number and provide convenient method to perform 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.isGreaterThan('1.0.1')); // true
console.log(version.isGreaterThan('1.0.2alpha')); // true
console.log(version.isGreaterThan('1.0.2RC')); // false
console.log(version.isGreaterThan('1.0.2')); // false
console.log(version.isLessThan('1.0.2')); // true

console.log(version.match(1.0)); // true
console.log(version.match('1.0.2')); // true
Defined By

Properties

Ext.Version
view source
: Objectprivate
...

Defaults to: {}

Methods

Defined By

Instance methods

Ext.Version
view source
new( version ) : Ext.Version
Creates new Version object. ...

Creates new Version object.

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
view source
( packageName, since, closure, scope )
Create a closure for deprecated code. ...

Create a closure for deprecated code.

// This means Ext.oldMethod is only supported in 4.0.0beta and older.
// If Ext.getVersion('extjs') returns a version that is later than '4.0.0beta', for example '4.0.0RC',
// the closure will not be invoked
Ext.deprecate('extjs', '4.0.0beta', function() {
    Ext.oldMethod = Ext.newMethod;
    // ...
});

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

Ext.Version
view source
( target ) : Boolean
Returns whether this version equals to the supplied argument. ...

Returns whether this version equals to the supplied argument.

Parameters

Returns

  • Boolean

    true if this version equals to the target, false otherwise.

Ext.Version
view source
( ) : Number
Returns the build component value. ...

Returns the build component value.

Returns

Ext.Version
view source
( ) : Number
Returns the major component value. ...

Returns the major component value.

Returns

Ext.Version
view source
( ) : Number
Returns the minor component value. ...

Returns the minor component value.

Returns

Ext.Version
view source
( ) : Number
Returns the patch component value. ...

Returns the patch component value.

Returns

Returns the release component value. ...

Returns the release component value.

Returns

Returns shortVersion version without dots and release. ...

Returns shortVersion version without dots and release.

Returns

Ext.Version
view source
( [packageName] ) : Ext.Version
Get the version number of the supplied package name; will return the last registered version (last Ext.setVersion() c...

Get the version number of the supplied package name; will return the last registered version (last Ext.setVersion() call) if there's no package name given.

Parameters

  • packageName : String (optional)

    The package name, for example: 'core', 'touch', 'extjs'.

Returns

Ext.Version
view source
( target ) : Boolean
Convenient alias to isGreaterThan ...

Convenient alias to isGreaterThan

Parameters

Returns

Ext.Version
view source
( target ) : Boolean
Convenient alias to isGreaterThanOrEqual ...

Convenient alias to isGreaterThanOrEqual

Parameters

Returns

Ext.Version
view source
( target ) : Boolean
Returns whether this version if greater than the supplied argument. ...

Returns whether this version if greater than the supplied argument.

Parameters

Returns

  • Boolean

    true if this version if greater than the target, false otherwise.

Returns whether this version if greater than or equal to the supplied argument. ...

Returns whether this version if greater than or equal to the supplied argument.

Parameters

Returns

  • Boolean

    true if this version if greater than or equal to the target, false otherwise.

Ext.Version
view source
( target ) : Boolean
Returns whether this version if smaller than the supplied argument. ...

Returns whether this version if smaller than the supplied argument.

Parameters

Returns

  • Boolean

    true if this version if smaller than the target, false otherwise.

Ext.Version
view source
( target ) : Boolean
Returns whether this version if less than or equal to the supplied argument. ...

Returns whether this version if less than or equal to the supplied argument.

Parameters

Returns

  • Boolean

    true if this version if less than or equal to the target, false otherwise.

Ext.Version
view source
( target ) : Boolean
Convenient alias to isLessThan ...

Convenient alias to isLessThan

Parameters

Returns

Ext.Version
view source
( target ) : Boolean
Convenient alias to isLessThanOrEqual ...

Convenient alias to isLessThanOrEqual

Parameters

Returns

Ext.Version
view source
( target ) : Boolean
Returns whether this version matches the supplied argument. ...

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

Returns

  • Boolean

    true if this version matches the target, false otherwise.

Ext.Version
view source
( packageName, version ) : Extchainable
Set version number for the given package name. ...

Set version number for the given package name.

Parameters

  • packageName : String

    The package name, for example: 'core', 'touch', 'extjs'.

  • version : String/Ext.Version

    The version, for example: '1.2.3alpha', '2.4.0-dev'.

Returns

Ext.Version
view source
( ) : Number[]
Returns this format: [major, minor, patch, build, release]. ...

Returns this format: [major, minor, patch, build, release]. Useful for comparison.

Returns

Fires

    Ext.Version
    view source
    ( value ) : Number
    ...

    Parameters

    Returns

    Ext.Version
    view source
    ( ) : Stringprivate
    Override the native toString() method. ...

    Override the native toString() method.

    Returns

    Ext.Version
    view source
    ( ) : Stringprivate
    Override the native valueOf() method. ...

    Override the native valueOf() method.

    Returns

    Defined By

    Static methods

    Ext.Version
    view source
    ( current, target ) : Numberstatic
    Compare 2 specified versions, starting from left to right. ...

    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.

    Ext.Version
    view source
    ( value ) : Objectstatic
    Converts a version component to a comparable value. ...

    Converts a version component to a comparable value.

    Parameters

    • value : Object

      The value to convert

    Returns