May 09, 2021 Extjs
It is used to return the true value in Android OS; |
Here are a few built-in functions, mainly used in Ext JS:
Ext.is class:
This type checks the platform you're using, whether it's your phone or desktop, Mac, or Windows operating system.
These are the following Ext.is related to the class
method | describe |
---|---|
Ext.is.Platforms
|
This method is used to return a platform for the current version.
E.g. When you run the following function, it returns as follows: [Object { property="platform", regex=RegExp, identity="iPhone"}, Object { property="platform", regex=RegExp, identity="iPod"}, Object { property="userAgent", regex=RegExp, identity="iPad"}, Object { property="userAgent", regex=RegExp, identity="Blackberry"}, Object { property="userAgent", regex=RegExp, identity="Android"}, Object { property="platform", regex=RegExp, identity="Mac"}, Object { property="platform", regex=RegExp, identity="Windows"}, Object { property="platform", regex=RegExp, identity="Linux"}] |
Ext.is.Android
|
It is used to return true values in Android OS; otherwise returns false.
|
Ext.is.Desktop
|
If you are using a desktop, this function will return true, otherwise returns false.
|
Ext.is.iPhone
|
This function will return true, if you use a mobile phone, this method returns true; otherwise, this method returns true.Otherwise, it returns false.
|
Ext.is.Phone
|
If you are using iPhone, this method returns true; otherwise, this method returns true.Otherwise, it returns false.Use iPhone's else it returns false.
|
Ext.is.iPod |
If you use the iPod, it will return true, otherwise returns false.
|
Ext.is.iPad
|
If you use the iPad, it will return true, otherwise returns false
|
Ext.is.Linux
|
If you are using a Linux operating system, returns true, otherwise returns false.
|
Ext.is.Mac
|
Returns true if you are using the Mac operating system, otherwise returns false.
|
Ext.is.Blackberry
|
If you are using the BlackBerry operating system, returns true, otherwise returns false. |
Ext.is.Windows
|
If you use a Windows operating system, returns true, otherwise returns false.
|
Ext.supports class:
Because the name means that this class provides information about the features supported by the browser/device, it is basically the current environment.
method | describe |
---|---|
Ext.supports.History
|
This returns a Boolean device-based device support HTML 5 history as Window.history or not support.If the device supports history, then it returns true otherwise false.
|
Ext.supports.GeoLocation
|
This returns to the Boolean-based device supports geolocation method.Internally it checks the navigator.geolocation method.
|
Ext.supports.Svg
|
This returns the Boolean device-based device to support the HTML 5 function scalable vector graphics (SVG) method.Inside it checks Doc.createElementns & amp; & amp ;!! doc.createElementns ("http: /" + "/ www.w3.org/2000/svg" "svg").CreatesvgRect.
|
Ext.supports.Canvas
|
This returned Boolean value is based on the device supported HTML 5 function Canvas draws a method.Inside it checks Doc.createElement (\ 'canvas \').GetContext is based on the output return value of this method.
|
Ext.supports.Range
|
This returned Boolean value is not based on the Document.createRange method supported by the browser.
|
Ext.String class:
The Ext.String class has a variety of methods for processing string data, the most commonly used methods are encoding decoding, trimming, switching, urlAppend eyc.
Coded decoding functions: These are the functions available in the Ext.String class to encode and decode HTML values.
method
|
describe |
---|---|
Ext.String.htmlEncode
|
This function is used to encode the HTML value to make it resolved.
E.g. Ext.String.htmlEncode("< p > Hello World < /p >"); Output - "< p > Hello World < /p >". |
Ext.String.htmlDecode
|
This function is used to decode the encoded HTML value
E.g. Ext.String.htmlDecode("< p > Hello World < /p >"); Output - "< p > Hello World < /p >" |
Ext.String.trim
|
This function is used to delete unwanted spaces in a string.
E.g. Ext.String.trim(\'hello\'); Output - "Hello" |
Ext.String.urlAppend
|
This method is used to add value in the URL string
E.g. Ext.String.urlAppend(\'https://www.google.com\',\'hello\'); Output - "https://www.google.com?hello" Ext.String.urlAppend(\'https://www.google.com?index=1\',\'hello\'); Output - "https://www.google.com?index=1&hello" |
Ext.String.toggle
|
This function is used to switch between two different values.
E.g. var toggleString =\'ASC\' toggleString = Ext.String.toggle(a,\'ASC\',\'DESC\'); Output - DESC has a value ASC as Togglestring. Now if we print the same, we will get Togglestring = "ASC" this time because it's value \ 'desc \'. It is similar to a three-yuan operator toggleString =((toggleString ==\'ASC\')?\'DESC\':\'ASC\'); |
Other methods
method
|
describe | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Ext.userAgent()
|
This function provides information about the browser UserAgent.UseERAgent is used to identify browsers and operating systems for web servers.
E.g. If you work in Mozilla, it will return some things: "Mozilla / 5.0 (Windows NT 6.1; Wow64; RV: 43.0) Gecko / 20100101 Firefox / 43.0" |
||||||||||||||
Version related features
|
These functions returns to the version of the browser currently being used. If you call the IE-related function in the Firefox browser, it returns 0. These functions are ext.firefoxversion, ext.ieversion, and so on.
E.g. If we use the Firefox browser, we call Method Ext.ieversion to get version of IE, then it returns 0 or if we use the same method in the IE browser, then it will return our version, such as 8, 9, etc. |
||||||||||||||
Ext.getVersion()
|
This function returns the currently used EXT JS version.
E.g. If we call ext.getversion (), it returns an array of values, such as version, short versions, etc. Ext.getversion ().Version Returns the current version of EXT JS used in the program, such as "4.2.2". |
||||||||||||||
Browser related features
|
These functions returns the Boolean value based on the browser used.This method is ext.isie, ext.isie6, ext.isff06, ext.ischrome.
E.g. If we use the Chrome browser, the ext.ischrome function will return True, and the other will return false. |
||||||||||||||
Ext.typeOf()
|
This function returns the data type of the variable, for example
E.g. var a = 5; var b = 'hello'; Ext.typeOf(a); Output – Number Ext.typeOf(b); Output - String |
||||||||||||||
DataType
|
DataType Related Methods: These functions return to the Boolean value based on the data type of the variable. E.g. var a = ['a', 'bc']; var b = 'hello'; var c = 123; var emptyVariable; var definedVariable; function extraFunction(){return true;}
|