<p>Creates new Array object.</p> <p>Either a number that specifies the length of array or any number of items for the array.</p> <p>Reflects the number of elements in an array.</p> <p>The value of the <code>length</code> property is an integer with a positive sign and a value less than 2 to the 32 power (232).</p> <p>You can set the <code>length</code> property to truncate an array at any time. When you extend an array by changing its <code>length</code> property, the number of actual elements does not increase; for example, if you set <code>length</code> to 3 when it is currently 2, the array still contains only 2 elements.</p> <p>In the following example the array numbers is iterated through by looking at the <code>length</code> property to see how many elements it has. Each value is then doubled.</p> <pre><code>var numbers = [1,2,3,4,5]; for (var i = 0; i &lt; numbers.length; i++) { numbers[i] *= 2; } // numbers is now [2,4,6,8,10]; </code></pre> <p>The following example shortens the array <code>statesUS</code> to a length of 50 if the current <code>length</code> is greater than 50.</p> <pre><code>if (statesUS.length &gt; 50) { statesUS.length=50 } </code></pre> <p>Returns a new array comprised of this array joined with other array(s) and/or value(s).</p> <p><code>concat</code> creates a new array consisting of the elements in the <code>this</code> object on which it is called, followed in order by, for each argument, the elements of that argument (if the argument is an array) or the argument itself (if the argument is not an array).</p> <p><code>concat</code> does not alter <code>this</code> or any of the arrays provided as arguments but instead returns a "one level deep" copy that contains copies of the same elements combined from the original arrays. Elements of the original arrays are copied into the new array as follows: Object references (and not the actual object): <code>concat</code> copies object references into the new array. Both the original and new array refer to the same object. That is, if a referenced object is modified, the changes are visible to both the new and original arrays. Strings and numbers (not <a href="#!/api/String" rel="String" class="docClass">String</a> and <a href="#!/api/Number" rel="Number" class="docClass">Number</a> objects): <code>concat</code> copies the values of strings and numbers into the new array.</p> <p>Any operation on the new array will have no effect on the original arrays, and vice versa.</p> <h3>Concatenating two arrays</h3> <p>The following code concatenates two arrays:</p> <pre><code>var alpha = ["a", "b", "c"]; var numeric = [1, 2, 3]; // creates array ["a", "b", "c", 1, 2, 3]; alpha and numeric are unchanged var alphaNumeric = alpha.concat(numeric); </code></pre> <h3>Concatenating three arrays</h3> <p>The following code concatenates three arrays:</p> <pre><code>var num1 = [1, 2, 3]; var num2 = [4, 5, 6]; var num3 = [7, 8, 9]; // creates array [1, 2, 3, 4, 5, 6, 7, 8, 9]; num1, num2, num3 are unchanged var nums = num1.concat(num2, num3); </code></pre> <h3>Concatenating values to an array</h3> <p>The following code concatenates three values to an array:</p> <pre><code>var alpha = ['a', 'b', 'c']; // creates array ["a", "b", "c", 1, 2, 3], leaving alpha unchanged var alphaNumeric = alpha.concat(1, [2, 3]); </code></pre> <p>Joins all elements of an array into a string.</p> <p>The string conversions of all array elements are joined into one string.</p> <p>The following example creates an array, <code>a</code>, with three elements, then joins the array three times: using the default separator, then a comma and a space, and then a plus.</p> <pre><code>var a = new Array("Wind","Rain","Fire"); var myVar1 = a.join(); // assigns "Wind,Rain,Fire" to myVar1 var myVar2 = a.join(", "); // assigns "Wind, Rain, Fire" to myVar2 var myVar3 = a.join(" + "); // assigns "Wind + Rain + Fire" to myVar3 </code></pre> <p>The pop method removes the last element from an array and returns that value to the caller.</p> <p><code>pop</code> is intentionally generic; this method can be called or applied to objects resembling arrays. Objects which do not contain a length property reflecting the last in a series of consecutive, zero-based numerical properties may not behave in any meaningful manner.</p> <pre><code>var myFish = ["angel", "clown", "mandarin", "surgeon"]; var popped = myFish.pop(); alert(popped); // Alerts 'surgeon' </code></pre> <p>Adds one or more elements to the end of an array and returns the new length of the array.</p> <p><code>push</code> is intentionally generic. This method can be called or applied to objects resembling arrays. The push method relies on a length property to determine where to start inserting the given values. If the length property cannot be converted into a number, the index used is 0. This includes the possibility of length being nonexistent, in which case length will also be created.</p> <p>The only native, array-like objects are strings, although they are not suitable in applications of this method, as strings are immutable.</p> <h3>Adding elements to an array</h3> <p>The following code creates the sports array containing two elements, then appends two elements to it. After the code executes, sports contains 4 elements: "soccer", "baseball", "football" and "swimming".</p> <pre><code>var sports = ["soccer", "baseball"]; sports.push("football", "swimming"); </code></pre> <p>Reverses the order of the elements of an array -- the first becomes the last, and the last becomes the first.</p> <p>The reverse method transposes the elements of the calling array object in place, mutating the array, and returning a reference to the array.</p> <p>The following example creates an array myArray, containing three elements, then reverses the array.</p> <pre><code>var myArray = ["one", "two", "three"]; myArray.reverse(); </code></pre> <p>This code changes myArray so that:</p> <ul> <li>myArray[0] is "three"</li> <li>myArray[1] is "two"</li> <li>myArray[2] is "one"</li> </ul> <p>Removes the first element from an array and returns that element.</p> <p>The <code>shift</code> method removes the element at the zeroeth index and shifts the values at consecutive indexes down, then returns the removed value.</p> <p><code>shift</code> is intentionally generic; this method can be called or applied to objects resembling arrays. Objects which do not contain a <code>length</code> property reflecting the last in a series of consecutive, zero-based numerical properties may not behave in any meaningful manner.</p> <p>The following code displays the <code>myFish</code> array before and after removing its first element. It also displays the removed element:</p> <pre><code>// assumes a println function is defined var myFish = ["angel", "clown", "mandarin", "surgeon"]; println("myFish before: " + myFish); var shifted = myFish.shift(); println("myFish after: " + myFish); println("Removed this element: " + shifted); </code></pre> <p>This example displays the following:</p> <pre><code>myFish before: angel,clown,mandarin,surgeon myFish after: clown,mandarin,surgeon Removed this element: angel </code></pre> <p>Extracts a section of an array and returns a new array.</p> <p><code>slice</code> does not alter the original array, but returns a new "one level deep" copy that contains copies of the elements sliced from the original array. Elements of the original array are copied into the new array as follows: * For object references (and not the actual object), <code>slice</code> copies object references into the new array. Both the original and new array refer to the same object. If a referenced object changes, the changes are visible to both the new and original arrays. * For strings and numbers (not <a href="#!/api/String" rel="String" class="docClass">String</a> and <a href="#!/api/Number" rel="Number" class="docClass">Number</a> objects), <code>slice</code> copies strings and numbers into the new array. Changes to the string or number in one array does not affect the other array.</p> <p>If a new element is added to either array, the other array is not affected.</p> <h3>Using slice</h3> <p>In the following example, <code>slice</code> creates a new array, <code>newCar</code>, from <code>myCar</code>. Both include a reference to the object <code>myHonda</code>. When the color of <code>myHonda</code> is changed to purple, both arrays reflect the change.</p> <pre><code>// Using slice, create newCar from myCar. var myHonda = { color: "red", wheels: 4, engine: { cylinders: 4, size: 2.2 } }; var myCar = [myHonda, 2, "cherry condition", "purchased 1997"]; var newCar = myCar.slice(0, 2); // Print the values of myCar, newCar, and the color of myHonda // referenced from both arrays. print("myCar = " + myCar.toSource()); print("newCar = " + newCar.toSource()); print("myCar[0].color = " + myCar[0].color); print("newCar[0].color = " + newCar[0].color); // Change the color of myHonda. myHonda.color = "purple"; print("The new color of my Honda is " + myHonda.color); // Print the color of myHonda referenced from both arrays. print("myCar[0].color = " + myCar[0].color); print("newCar[0].color = " + newCar[0].color); </code></pre> <p>This script writes:</p> <pre><code>myCar = [{color:"red", wheels:4, engine:{cylinders:4, size:2.2}}, 2, "cherry condition", "purchased 1997"] newCar = [{color:"red", wheels:4, engine:{cylinders:4, size:2.2}}, 2] myCar[0].color = red newCar[0].color = red The new color of my Honda is purple myCar[0].color = purple newCar[0].color = purple </code></pre> <p>Sorts the elements of an array.</p> <p>If <code>compareFunction</code> is not supplied, elements are sorted by converting them to strings and comparing strings in lexicographic ("dictionary" or "telephone book," not numerical) order. For example, "80" comes before "9" in lexicographic order, but in a numeric sort 9 comes before 80.</p> <p>If <code>compareFunction</code> is supplied, the array elements are sorted according to the return value of the compare function. If a and b are two elements being compared, then: If <code>compareFunction(a, b)</code> is less than 0, sort <code>a</code> to a lower index than <code>b</code>. If <code>compareFunction(a, b)</code> returns 0, leave <code>a</code> and <code>b</code> unchanged with respect to each other, but sorted with respect to all different elements. Note: the ECMAscript standard does not guarantee this behaviour, and thus not all browsers respect this. If <code>compareFunction(a, b)</code> is greater than 0, sort <code>b</code> to a lower index than <code>a</code>. <code>compareFunction(a, b)</code> must always returns the same value when given a specific pair of elements a and b as its two arguments. If inconsistent results are returned then the sort order is undefined</p> <p>So, the compare function has the following form:</p> <pre><code>function compare(a, b) { if (a is less than b by some ordering criterion) return -1; if (a is greater than b by the ordering criterion) return 1; // a must be equal to b return 0; } </code></pre> <p>To compare numbers instead of strings, the compare function can simply subtract <code>b</code> from <code>a</code>:</p> <pre><code>function compareNumbers(a, b) { return a - b; } </code></pre> <p>The sort() method can be conveniently used with closures:</p> <pre><code>var numbers = [4, 2, 5, 1, 3]; numbers.sort(function(a, b) { return a - b; }); print(numbers); </code></pre> <p>Adds and/or removes elements from an array.</p> <p>If you specify a different number of elements to insert than the number you're removing, the array will have a different length at the end of the call.</p> <pre><code>// assumes a print function is defined var myFish = ["angel", "clown", "mandarin", "surgeon"]; print("myFish: " + myFish); var removed = myFish.splice(2, 0, "drum"); print("After adding 1: " + myFish); print("removed is: " + removed); removed = myFish.splice(3, 1); print("After removing 1: " + myFish); print("removed is: " + removed); removed = myFish.splice(2, 1, "trumpet"); print("After replacing 1: " + myFish); print("removed is: " + removed); removed = myFish.splice(0, 2, "parrot", "anemone", "blue"); print("After replacing 2: " + myFish); print("removed is: " + removed); </code></pre> <p>This script displays:</p> <pre><code>myFish: angel,clown,mandarin,surgeon After adding 1: angel,clown,drum,mandarin,surgeon removed is: After removing 1: angel,clown,drum,surgeon removed is: mandarin After replacing 1: angel,clown,trumpet,surgeon removed is: drum After replacing 2: parrot,anemone,blue,trumpet,surgeon removed is: angel,clown </code></pre> <p>Returns a string representing the array and its elements. Overrides the <code>Object.prototype.toString</code> method.</p> <p>The <a href="#!/api/Array" rel="Array" class="docClass">Array</a> object overrides the <code>toString</code> method of <a href="#!/api/Object" rel="Object" class="docClass">Object</a>. For Array objects, the <code>toString</code> method joins the array and returns one string containing each array element separated by commas. For example, the following code creates an array and uses <code>toString</code> to convert the array to a string.</p> <pre><code>var monthNames = new Array("Jan","Feb","Mar","Apr"); myVar = monthNames.toString(); // assigns "Jan,Feb,Mar,Apr" to myVar </code></pre> <p>JavaScript calls the <code>toString</code> method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation.</p> <p>Adds one or more elements to the front of an array and returns the new length of the array.</p> <p>The <code>unshift</code> method inserts the given values to the beginning of an array-like object.</p> <p><code>unshift</code> is intentionally generic; this method can be called or applied to objects resembling arrays. Objects which do not contain a <code>length</code> property reflecting the last in a series of consecutive, zero-based numerical properties may not behave in any meaningful manner.</p> <p>The following code displays the myFish array before and after adding elements to it.</p> <pre><code>// assumes a println function exists myFish = ["angel", "clown"]; println("myFish before: " + myFish); unshifted = myFish.unshift("drum", "lion"); println("myFish after: " + myFish); println("New length: " + unshifted); </code></pre> <p>This example displays the following:</p> <pre><code>myFish before: ["angel", "clown"] myFish after: ["drum", "lion", "angel", "clown"] New length: 4 </code></pre> <p>Creates a new boolean object.</p> <p>Either a truthy or falsy value to create the corresponding Boolean object.</p> <p>Returns a string of either "true" or "false" depending upon the value of the object. Overrides the <code>Object.prototype.toString</code> method.</p> <p>The Boolean object overrides the <code>toString</code> method of the <code>Object</code> object; it does not inherit <code><a href="#!/api/Object-method-toString" rel="Object-method-toString" class="docClass">Object.toString</a></code>. For Boolean objects, the <code>toString</code> method returns a string representation of the object.</p> <p>JavaScript calls the <code>toString</code> method automatically when a Boolean is to be represented as a text value or when a Boolean is referred to in a string concatenation.</p> <p>For Boolean objects and values, the built-in <code>toString</code> method returns the string <code>"true"</code> or <code>"false"</code> depending on the value of the boolean object. In the following code, <code>flag.toString</code> returns <code>"true"</code>.</p> <pre><code>var flag = new Boolean(true) var myVar = flag.toString() </code></pre> <p>Returns the primitive value of the <code>Boolean</code> object. Overrides the <code>Object.prototype.valueOf</code> method.</p> <p>The <code>valueOf</code> method of Boolean returns the primitive value of a Boolean object or literal Boolean as a Boolean data type.</p> <p>This method is usually called internally by JavaScript and not explicitly in code.</p> <pre><code>x = new Boolean(); myVar = x.valueOf() //assigns false to myVar </code></pre> <p>Creates new Date object.</p> <p>Either UNIX timestamp, date string, or year (when month and day parameters also provided):</p> <ul> <li><p>Integer value representing the number of milliseconds since 1 January 1970 00:00:00 UTC (Unix Epoch).</p></li> <li><p>String value representing a date. The string should be in a format recognized by the parse method (IETF-compliant RFC 1123 timestamps).</p></li> <li><p>Integer value representing the year. For compatibility (in order to avoid the Y2K problem), you should always specify the year in full; use 1998, rather than 98.</p></li> </ul> <p>Integer value representing the month, beginning with 0 for January to 11 for December.</p> <p>Integer value representing the day of the month (1-31).</p> <p>Integer value representing the hour of the day (0-23).</p> <p>Integer value representing the minute segment (0-59) of a time reading.</p> <p>Integer value representing the second segment (0-59) of a time reading.</p> <p>Integer value representing the millisecond segment (0-999) of a time reading.</p> <p>Returns the numeric value corresponding to the current time.</p> <p>The second statement below assigns the value 25 to the variable <code>day</code>, based on the value of the <code>Date</code> object <code>Xmas95</code>.</p> <pre><code>Xmas95 = new Date("December 25, 1995 23:15:00") day = Xmas95.getDate() </code></pre> <p>Returns the numeric value corresponding to the current time.</p> <p>The value returned by <code>getDay</code> is an integer corresponding to the day of the week: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on.</p> <p>The second statement below assigns the value 1 to <code>weekday</code>, based on the value of the <code>Date</code> object <code>Xmas95</code>. December 25, 1995, is a Monday.</p> <pre><code>Xmas95 = new Date("December 25, 1995 23:15:00"); weekday = Xmas95.getDay(); </code></pre> <p>Returns the numeric value corresponding to the current time.</p> <p>The value returned by <code>getFullYear</code> is an absolute number. For dates between the years 1000 and 9999, <code>getFullYear</code> returns a four-digit number, for example, 1995. Use this function to make sure a year is compliant with years after 2000.</p> <p>Use this method instead of the <code>getYear</code> method.</p> <p>The following example assigns the four-digit value of the current year to the variable yr.</p> <pre><code>var today = new Date(); var yr = today.getFullYear(); </code></pre> <p>Returns the numeric value corresponding to the current time.</p> <p>The second statement below assigns the value 23 to the variable <code>hours</code>, based on the value of the <code>Date</code> object <code>Xmas95</code>.</p> <pre><code>Xmas95 = new Date("December 25, 1995 23:15:00") hours = Xmas95.getHours() </code></pre> <p>Returns the numeric value corresponding to the current time.</p> <p>The following example assigns the milliseconds portion of the current time to the variable ms.</p> <pre><code>var ms; Today = new Date(); ms = Today.getMilliseconds(); </code></pre> <p>Returns the numeric value corresponding to the current time.</p> <p>The second statement below assigns the value 15 to the variable <code>minutes</code>, based on the value of the <code>Date</code> object <code>Xmas95</code>.</p> <pre><code>Xmas95 = new Date("December 25, 1995 23:15:00") minutes = Xmas95.getMinutes() </code></pre> <p>Returns the numeric value corresponding to the current time.</p> <p>The second statement below assigns the value 11 to the variable <code>month</code>, based on the value of the <code>Date</code> object <code>Xmas95</code>.</p> <pre><code>Xmas95 = new Date("December 25, 1995 23:15:00") month = Xmas95.getMonth() </code></pre> <p>Returns the numeric value corresponding to the current time.</p> <p>The second statement below assigns the value 30 to the variable <code>secs</code>, based on the value of the <code>Date</code> object <code>Xmas95</code>.</p> <pre><code>Xmas95 = new Date("December 25, 1995 23:15:30") secs = Xmas95.getSeconds() </code></pre> <p>Returns the numeric value corresponding to the current time.</p> <p>The value returned by the <code>getTime</code> method is the number of milliseconds since 1 January 1970 00:00:00 UTC. You can use this method to help assign a date and time to another <code>Date</code> object.</p> <p>This method is functionally equivalent to the <code>valueOf</code> method.</p> <p>Using getTime for copying dates</p> <p>Constructing a date object with the identical time value.</p> <pre><code>var birthday = new Date(1994, 12, 10); var copy = new Date(); copy.setTime(birthday.getTime()); </code></pre> <p>Measuring execution time</p> <p>Subtracting two subsequent getTime calls on newly generated Date objects, give the time span between these two calls. This can be used to calculate the executing time of some operations.</p> <pre><code>var end, start; start = new Date(); for (var i = 0; i &lt; 1000; i++) Math.sqrt(i); end = new Date(); console.log("Operation took " + (end.getTime() - start.getTime()) + " msec"); </code></pre> <p>Returns the numeric value corresponding to the current time.</p> <p>The time-zone offset is the difference, in minutes, between UTC and local time. Note that this means that the offset is positive if the local timezone is behind UTC and negative if it is ahead. For example, if your time zone is UTC+10 (Australian Eastern Standard Time), -600 will be returned. Daylight savings time prevents this value from being a constant even for a given locale</p> <pre><code>x = new Date() currentTimeZoneOffsetInHours = x.getTimezoneOffset()/60 </code></pre> <p>Returns the numeric value corresponding to the current time.</p> <p>The following example assigns the day portion of the current date to the variable <code>d</code>.</p> <pre><code>var d; Today = new Date(); d = Today.getUTCDate(); </code></pre> <p>Returns the numeric value corresponding to the current time.</p> <p>The following example assigns the weekday portion of the current date to the variable <code>weekday</code>.</p> <pre><code>var weekday; Today = new Date() weekday = Today.getUTCDay() </code></pre> <p>Returns the numeric value corresponding to the current time.</p> <p>The following example assigns the four-digit value of the current year to the variable <code>yr</code>.</p> <pre><code>var yr; Today = new Date(); yr = Today.getUTCFullYear(); </code></pre> <p>Returns the numeric value corresponding to the current time.</p> <p>The following example assigns the hours portion of the current time to the variable <code>hrs</code>.</p> <pre><code>var hrs; Today = new Date(); hrs = Today.getUTCHours(); </code></pre> <p>Returns the numeric value corresponding to the current time.</p> <p>The following example assigns the milliseconds portion of the current time to the variable <code>ms</code>.</p> <pre><code>var ms; Today = new Date(); ms = Today.getUTCMilliseconds(); </code></pre> <p>Returns the numeric value corresponding to the current time.</p> <p>The following example assigns the minutes portion of the current time to the variable <code>min</code>.</p> <pre><code>var min; Today = new Date(); min = Today.getUTCMinutes(); </code></pre> <p>Returns the numeric value corresponding to the current time.</p> <p>The following example assigns the month portion of the current date to the variable <code>mon</code>.</p> <pre><code>var mon; Today = new Date(); mon = Today.getUTCMonth(); </code></pre> <p>Returns the numeric value corresponding to the current time.</p> <p>The following example assigns the seconds portion of the current time to the variable <code>sec</code>.</p> <pre><code>var sec; Today = new Date(); sec = Today.getUTCSeconds(); </code></pre> <p>Sets the day of the month (1-31) for a specified date according to local time.</p> <p>If the parameter you specify is outside of the expected range, <code>setDate</code> attempts to update the date information in the <code>Date</code> object accordingly. For example, if you use 0 for <code>dayValue</code>, the date will be set to the last day of the previous month.</p> <p>The second statement below changes the day for theBigDay to July 24 from its original value.</p> <pre><code>theBigDay = new Date("July 27, 1962 23:30:00") theBigDay.setDate(24) </code></pre> <p>Sets the full year (4 digits for 4-digit years) for a specified date according to local time.</p> <p>If you do not specify the <code>monthValue</code> and <code>dayValue</code> parameters, the values returned from the <code>getMonth</code> and <code>getDate</code> methods are used.</p> <p>If a parameter you specify is outside of the expected range, <code>setFullYear</code> attempts to update the other parameters and the date information in the <code>Date</code> object accordingly. For example, if you specify 15 for monthValue, the year is incremented by 1 (year + 1), and 3 is used for the month.</p> <p>theBigDay = new Date(); theBigDay.setFullYear(1997);</p> <p>Sets the hours (0-23) for a specified date according to local time.</p> <p>If you do not specify the <code>minutesValue</code>, <code>secondsValue</code>, and <code>msValue</code> parameters, the values returned from the <code>getUTCMinutes</code>, <code>getUTCSeconds</code>, and <code>getMilliseconds</code> methods are used.</p> <p>If a parameter you specify is outside of the expected range, setHours attempts to update the date information in the <code>Date</code> object accordingly. For example, if you use 100 for <code>secondsValue</code>, the minutes will be incremented by 1 (min + 1), and 40 will be used for seconds.</p> <pre><code>theBigDay.setHours(7) </code></pre> <p>Sets the milliseconds (0-999) for a specified date according to local time.</p> <p>If you specify a number outside the expected range, the date information in the <code>Date</code> object is updated accordingly. For example, if you specify 1005, the number of seconds is incremented by 1, and 5 is used for the milliseconds.</p> <pre><code>theBigDay = new Date(); theBigDay.setMilliseconds(100); </code></pre> <p>Sets the minutes (0-59) for a specified date according to local time.</p> <p>If you do not specify the <code>secondsValue</code> and <code>msValue</code> parameters, the values returned from <code>getSeconds</code> and <code>getMilliseconds</code> methods are used.</p> <p>If a parameter you specify is outside of the expected range, <code>setMinutes</code> attempts to update the date information in the <code>Date</code> object accordingly. For example, if you use 100 for <code>secondsValue</code>, the minutes (<code>minutesValue</code>) will be incremented by 1 (minutesValue + 1), and 40 will be used for seconds.</p> <pre><code>theBigDay.setMinutes(45) </code></pre> <p>Sets the month (0-11) for a specified date according to local time.</p> <p>If you do not specify the <code>dayValue</code> parameter, the value returned from the <code>getDate</code> method is used.</p> <p>If a parameter you specify is outside of the expected range, <code>setMonth</code> attempts to update the date information in the <code>Date</code> object accordingly. For example, if you use 15 for <code>monthValue</code>, the year will be incremented by 1 (year + 1), and 3 will be used for month.</p> <pre><code>theBigDay.setMonth(6) </code></pre> <p>Sets the seconds (0-59) for a specified date according to local time.</p> <p>If you do not specify the <code>msValue</code> parameter, the value returned from the <code>getMilliseconds</code> method is used.</p> <p>If a parameter you specify is outside of the expected range, <code>setSeconds</code> attempts to update the date information in the <code>Date</code> object accordingly. For example, if you use 100 for <code>secondsValue</code>, the minutes stored in the <code>Date</code> object will be incremented by 1, and 40 will be used for seconds.</p> <pre><code>theBigDay.setSeconds(30) </code></pre> <p>Sets the Date object to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC, allowing for negative numbers for times prior.</p> <p>Use the <code>setTime</code> method to help assign a date and time to another <code>Date</code> object.</p> <pre><code>theBigDay = new Date("July 1, 1999") sameAsBigDay = new Date() sameAsBigDay.setTime(theBigDay.getTime()) </code></pre> <p>Sets the day of the month (1-31) for a specified date according to universal time.</p> <p>If a parameter you specify is outside of the expected range, <code>setUTCDate</code> attempts to update the date information in the <code>Date</code> object accordingly. For example, if you use 40 for <code>dayValue</code>, and the month stored in the <code>Date</code> object is June, the day will be changed to 10 and the month will be incremented to July.</p> <pre><code>theBigDay = new Date(); theBigDay.setUTCDate(20); </code></pre> <p>Sets the full year (4 digits for 4-digit years) for a specified date according to universal time.</p> <p>If you do not specify the <code>monthValue</code> and <code>dayValue</code> parameters, the values returned from the <code>getMonth</code> and <code>getDate</code> methods are used.</p> <p>If a parameter you specify is outside of the expected range, <code>setUTCFullYear</code> attempts to update the other parameters and the date information in the <code>Date</code> object accordingly. For example, if you specify 15 for <code>monthValue</code>, the year is incremented by 1 (year + 1), and 3 is used for the month.</p> <pre><code>theBigDay = new Date(); theBigDay.setUTCFullYear(1997); </code></pre> <p>Sets the hour (0-23) for a specified date according to universal time.</p> <p>If you do not specify the <code>minutesValue</code>, <code>secondsValue</code>, and <code>msValue</code> parameters, the values returned from the <code>getUTCMinutes</code>, <code>getUTCSeconds</code>, and <code>getUTCMilliseconds</code> methods are used.</p> <p>If a parameter you specify is outside of the expected range, <code>setUTCHours</code> attempts to update the date information in the <code>Date</code> object accordingly. For example, if you use 100 for <code>secondsValue</code>, the minutes will be incremented by 1 (min + 1), and 40 will be used for seconds.</p> <pre><code>theBigDay = new Date(); theBigDay.setUTCHours(8); </code></pre> <p>Sets the milliseconds (0-999) for a specified date according to universal time.</p> <p>If a parameter you specify is outside of the expected range, <code>setUTCMilliseconds</code> attempts to update the date information in the <code>Date</code> object accordingly. For example, if you use 1100 for <code>millisecondsValue</code>, the seconds stored in the Date object will be incremented by 1, and 100 will be used for milliseconds.</p> <pre><code>theBigDay = new Date(); theBigDay.setUTCMilliseconds(500); </code></pre> <p>Sets the minutes (0-59) for a specified date according to universal time.</p> <p>If you do not specify the <code>secondsValue</code> and <code>msValue</code> parameters, the values returned from <code>getUTCSeconds</code> and <code>getUTCMilliseconds</code> methods are used.</p> <p>If a parameter you specify is outside of the expected range, <code>setUTCMinutes</code> attempts to update the date information in the <code>Date</code> object accordingly. For example, if you use 100 for <code>secondsValue</code>, the minutes (<code>minutesValue</code>) will be incremented by 1 (<code>minutesValue</code> + 1), and 40 will be used for seconds.</p> <pre><code>theBigDay = new Date(); theBigDay.setUTCMinutes(43); </code></pre> <p>Sets the month (0-11) for a specified date according to universal time.</p> <p>If you do not specify the <code>dayValue</code> parameter, the value returned from the <code>getUTCDate</code> method is used.</p> <p>If a parameter you specify is outside of the expected range, <code>setUTCMonth</code> attempts to update the date information in the <code>Date</code> object accordingly. For example, if you use 15 for <code>monthValue</code>, the year will be incremented by 1 (year + 1), and 3 will be used for month.</p> <pre><code>theBigDay = new Date(); theBigDay.setUTCMonth(11); </code></pre> <p>Sets the seconds (0-59) for a specified date according to universal time.</p> <p>If you do not specify the <code>msValue</code> parameter, the value returned from the <code>getUTCMilliseconds</code> methods is used.</p> <p>If a parameter you specify is outside of the expected range, <code>setUTCSeconds</code> attempts to update the date information in the <code>Date</code> object accordingly. For example, if you use 100 for <code>secondsValue</code>, the minutes stored in the <code>Date</code> object will be incremented by 1, and 40 will be used for seconds.</p> <pre><code>theBigDay = new Date(); theBigDay.setUTCSeconds(20); </code></pre> <p>Returns the "date" portion of the Date as a human-readable string in American English.</p> <p><a href="#!/api/Date" rel="Date" class="docClass">Date</a> instances refer to a specific point in time. Calling <code>toString</code> will return the date formatted in a human readable form in American English. In SpiderMonkey, this consists of the date portion (day, month, and year) followed by the time portion (hours, minutes, seconds, and time zone). Sometimes it is desirable to obtain a string of the date portion; such a thing can be accomplished with the <code>toDateString</code> method.</p> <p>The <code>toDateString</code> method is especially useful because compliant engines implementing ECMA-262 may differ in the string obtained from <code>toString</code> for <code>Date</code> objects, as the format is implementation- dependent and simple string slicing approaches may not produce consistent results across multiple engines.</p> <pre><code>var d = new Date(1993, 6, 28, 14, 39, 7); println(d.toString()); // prints Wed Jul 28 1993 14:39:07 GMT-0600 (PDT) println(d.toDateString()); // prints Wed Jul 28 1993 </code></pre> <p>Returns the "date" portion of the Date as a string, using the current locale's conventions.</p> <p>The <code>toLocaleDateString</code> method relies on the underlying operating system in formatting dates. It converts the date to a string using the formatting convention of the operating system where the script is running. For example, in the United States, the month appears before the date (04/15/98), whereas in Germany the date appears before the month (15.04.98). If the operating system is not year-2000 compliant and does not use the full year for years before 1900 or over 2000, <code>toLocaleDateString</code> returns a string that is not year-2000 compliant. <code>toLocaleDateString</code> behaves similarly to <code>toString</code> when converting a year that the operating system does not properly format.</p> <p>Methods such as <code>getDate</code>, <code>getMonth</code>, and <code>getFullYear</code> give more portable results than <code>toLocaleDateString</code>. Use <code>toLocaleDateString</code> when the intent is to display to the user a string formatted using the regional format chosen by the user. Be aware that this method, due to its nature, behaves differently depending on the operating system and on the user's settings.</p> <p>In the following example, <code>today</code> is a <code>Date</code> object:</p> <pre><code>today = new Date(95,11,18,17,28,35) //months are represented by 0 to 11 today.toLocaleDateString() </code></pre> <p>In this example, <code>toLocaleDateString</code> returns a string value that is similar to the following form. The exact format depends on the platform, locale and user's settings.</p> <pre><code>12/18/95 </code></pre> <p>You shouldn't use this method in contexts where you rely on a particular format or locale.</p> <pre><code>"Last visit: " + someDate.toLocaleDateString(); // Good example "Last visit was at " + someDate.toLocaleDateString(); // Bad example </code></pre> <p>Converts a date to a string, using the current locale's conventions. Overrides the <code><a href="#!/api/Object-method-toLocaleString" rel="Object-method-toLocaleString" class="docClass">Object.toLocaleString</a></code> method.</p> <p>The <code>toLocaleString</code> method relies on the underlying operating system in formatting dates. It converts the date to a string using the formatting convention of the operating system where the script is running. For example, in the United States, the month appears before the date (04/15/98), whereas in Germany the date appears before the month (15.04.98). If the operating system is not year-2000 compliant and does not use the full year for years before 1900 or over 2000, <code>toLocaleString</code> returns a string that is not year-2000 compliant. <code>toLocaleString</code> behaves similarly to <code>toString</code> when converting a year that the operating system does not properly format.</p> <p>Methods such as <code>getDate</code>, <code>getMonth</code>, <code>getFullYear</code>, <code>getHours</code>, <code>getMinutes</code>, and <code>getSeconds</code> give more portable results than <code>toLocaleString</code>. Use <code>toLocaleString</code> when the intent is to display to the user a string formatted using the regional format chosen by the user. Be aware that this method, due to its nature, behaves differently depending on the operating system and on the user's settings.</p> <p>In the following example, <code>today</code> is a <code>Date</code> object:</p> <pre><code>today = new Date(95,11,18,17,28,35); //months are represented by 0 to 11 today.toLocaleString(); </code></pre> <p>In this example, <code>toLocaleString</code> returns a string value that is similar to the following form. The exact format depends on the platform, locale and user's settings.</p> <pre><code>12/18/95 17:28:35 </code></pre> <p>You shouldn't use this method in contexts where you rely on a particular format or locale.</p> <pre><code>"Last visit: " + someDate.toLocaleString(); // Good example "Last visit was at " + someDate.toLocaleString(); // Bad example </code></pre> <p>Returns the "time" portion of the Date as a string, using the current locale's conventions.</p> <p>The <code>toLocaleTimeString</code> method relies on the underlying operating system in formatting dates. It converts the date to a string using the formatting convention of the operating system where the script is running. For example, in the United States, the month appears before the date (04/15/98), whereas in Germany the date appears before the month (15.04.98).</p> <p>Methods such as <code>getHours</code>, <code>getMinutes</code>, and <code>getSeconds</code> give more consistent results than <code>toLocaleTimeString</code>. Use <code>toLocaleTimeString</code> when the intent is to display to the user a string formatted using the regional format chosen by the user. Be aware that this method, due to its nature, behaves differently depending on the operating system and on the user's settings.</p> <p>In the following example, <code>today</code> is a <code>Date</code> object:</p> <pre><code>today = new Date(95,11,18,17,28,35) //months are represented by 0 to 11 today.toLocaleTimeString() </code></pre> <p>In this example, <code>toLocaleTimeString</code> returns a string value that is similar to the following form. The exact format depends on the platform.</p> <pre><code>17:28:35 </code></pre> <p>You shouldn't use this method in contexts where you rely on a particular format or locale.</p> <pre><code>"Last visit: " + someDate.toLocaleTimeString(); // Good example "Last visit was at " + someDate.toLocaleTimeString(); // Bad example </code></pre> <p>Returns a string representing the specified Date object. Overrides the <code>Object.prototype.toString</code> method.</p> <p>The <code>Date</code> object overrides the toString method of the Object object; it does not inherit <code><a href="#!/api/Object-method-toString" rel="Object-method-toString" class="docClass">Object.toString</a></code>. For <code>Date</code> objects, the <code>toString</code> method returns a string representation of the object.</p> <p><code>toString</code> always returns a string representation of the date in American English.</p> <p>JavaScript calls the <code>toString</code> method automatically when a date is to be represented as a text value or when a date is referred to in a string concatenation.</p> <p>The following assigns the <code>toString</code> value of a <code>Date</code> object to <code>myVar</code>:</p> <pre><code>x = new Date(); myVar=x.toString(); //assigns a value to myVar similar to: //Mon Sep 28 1998 14:36:22 GMT-0700 (Pacific Daylight Time) </code></pre> <p>Returns the "time" portion of the Date as a human-readable string.</p> <p><a href="#!/api/Date" rel="Date" class="docClass">Date</a> instances refer to a specific point in time. Calling <code>toString</code> will return the date formatted in a human readable form in American English. In SpiderMonkey, this consists of the date portion (day, month, and year) followed by the time portion (hours, minutes, seconds, and time zone). Sometimes it is desirable to obtain a string of the time portion; such a thing can be accomplished with the <code>toTimeString</code> method.</p> <p>The <code>toTimeString</code> method is especially useful because compliant engines implementing ECMA-262 may differ in the string obtained from <code>toString</code> for <code>Date</code> objects, as the format is implementation- dependent; simple string slicing approaches may not produce consistent results across multiple engines.</p> <pre><code>var d = new Date(1993, 6, 28, 14, 39, 7); println(d.toString()); // prints Wed Jul 28 1993 14:39:07 GMT-0600 (PDT) println(d.toTimeString()); // prints 14:39:07 GMT-0600 (PDT) </code></pre> <p>Converts a date to a string, using the universal time convention.</p> <p>The value returned by <code>toUTCString</code> is a readable string in American English in the UTC time zone. The format of the return value may vary according to the platform.</p> <pre><code>var today = new Date(); var UTCstring = today.toUTCString(); // Mon, 03 Jul 2006 21:44:38 GMT </code></pre> <p>Returns the primitive value of a Date object. Overrides the Object.prototype.valueOf method.</p> <p>The <code>valueOf</code> method returns the primitive value of a <code>Date</code> object as a number data type, the number of milliseconds since midnight 01 January, 1970 UTC.</p> <p>This method is functionally equivalent to the <code>getTime</code> method.</p> <p>This method is usually called internally by JavaScript and not explicitly in code.</p> <pre><code>x = new Date(56, 6, 17); myVar = x.valueOf(); //assigns -424713600000 to myVar </code></pre> <p>Creates new Component.</p> <p>Config object.</p> <p>Setting this property to <code>true</code> causes the <a href="#!/api/Ext.AbstractComponent-method-isLayoutRoot" rel="Ext.AbstractComponent-method-isLayoutRoot" class="docClass">isLayoutRoot</a> method to return <code>true</code> and stop the search for the top-most component for a layout.</p> <p>Indicates whether or not the component can be dragged.</p> <p>Indicates the width of any framing elements which were added within the encapsulating element to provide graphical, rounded borders. See the <a href="#!/api/Ext.AbstractComponent-cfg-frame" rel="Ext.AbstractComponent-cfg-frame" class="docClass">frame</a> config.</p> <p>This is an object containing the frame width in pixels for all four sides of the Component containing the following properties:</p> <p>This is an internal flag that you use when creating custom components. By default this is set to true which means that every component gets a mask when its disabled. Components like FieldContainer, FieldSet, Field, Button, Tab override this property to false since they want to implement custom disable logic.</p> <p>This Component's owner <a href="#!/api/Ext.container.Container" rel="Ext.container.Container" class="docClass">Container</a> (is set automatically when this Component is added to a Container).</p> <p><strong>Note</strong>: to access items within the Container see <a href="#!/api/Ext.AbstractComponent-cfg-itemId" rel="Ext.AbstractComponent-cfg-itemId" class="docClass">itemId</a>.</p> <p>Indicates whether or not the component has been rendered.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Adds each argument passed to this method to the childEls array.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-addUIClsToElement" rel="Ext.AbstractComponent-method-addUIClsToElement" class="docClass">addUIClsToElement</a> and adds to all elements of this component.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Save a property to the given state object if it is not its default or configured value.</p> <p>Add events that will trigger the state to be saved. If the first argument is an array, each element of that array is the name of a state event. Otherwise, each argument passed to this method is the name of a state event.</p> <p>Method which adds a specified UI + uiCls to the components element. Can be overridden to remove the UI from more than just the components element.</p> <p>Called by the layout system when the Component has been layed out.</p> <p>Perform custom animation on this object.</p> <p>This method is applicable to both the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a> class and the <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a> class. It performs animated transitions of certain properties of this object over a specified timeline.</p> <p>The sole parameter is an object which specifies start property values, end property values, and properties which describe the timeline.</p> <h3>Animating an <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a></h3> <p>When animating an Element, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The page X position in pixels.</p></li> <li><p><code>y</code> - The page Y position in pixels</p></li> <li><p><code>left</code> - The element's CSS <code>left</code> value. Units must be supplied.</p></li> <li><p><code>top</code> - The element's CSS <code>top</code> value. Units must be supplied.</p></li> <li><p><code>width</code> - The element's CSS <code>width</code> value. Units must be supplied.</p></li> <li><p><code>height</code> - The element's CSS <code>height</code> value. Units must be supplied.</p></li> <li><p><code>scrollLeft</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>scrollTop</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>opacity</code> - The element's <code>opacity</code> value. This must be a value between <code>0</code> and <code>1</code>.</p></li> </ul> <p><strong>Be aware than animating an Element which is being used by an Ext Component without in some way informing the Component about the changed element state will result in incorrect Component behaviour. This is because the Component will be using the old state of the element. To avoid this problem, it is now possible to directly animate certain properties of Components.</strong></p> <h3>Animating a <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a></h3> <p>When animating a Component, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The Component's page X position in pixels.</p></li> <li><p><code>y</code> - The Component's page Y position in pixels</p></li> <li><p><code>left</code> - The Component's <code>left</code> value in pixels.</p></li> <li><p><code>top</code> - The Component's <code>top</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>dynamic</code> - Specify as true to update the Component's layout (if it is a Container) at every frame of the animation. <em>Use sparingly as laying out on every intermediate size change is an expensive operation.</em></p></li> </ul> <p>For example, to animate a Window to a new size, ensuring that its internal layout, and any shadow is correct:</p> <pre><code>myWindow = <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>', { title: 'Test Component animation', width: 500, height: 300, layout: { type: 'hbox', align: 'stretch' }, items: [{ title: 'Left: 33%', margins: '5 0 5 5', flex: 1 }, { title: 'Left: 66%', margins: '5 5 5 5', flex: 2 }] }); myWindow.show(); myWindow.header.el.on('click', function() { myWindow.animate({ to: { width: (myWindow.getWidth() == 500) ? 700 : 500, height: (myWindow.getHeight() == 300) ? 400 : 300, } }); }); </code></pre> <p>For performance reasons, by default, the internal layout is only updated when the Window reaches its final <code>"to"</code> size. If dynamic updating of the Window's child Components is required, then configure the animation with <code>dynamic: true</code> and the two child items will maintain their proportions during the animation.</p> <p>Applies the state to the object. This should be overridden in subclasses to do more complex state operations. By default it applies the state properties onto the current object.</p> <p>Utility wrapper that suspends layouts of all components for the duration of a given function.</p> <p>Occurs before componentLayout is run. Returning false from this method will prevent the componentLayout from being executed.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Ensures that the plugins array contains fully constructed plugin instances. This converts any configs into their appropriate instances.</p> <p>Destroys the Component.</p> <p>Disable the component.</p> <p>Handles autoRender. Floating Components may have an ownerCt. If they are asking to be constrained, constrain them within that ownerCt, and have their z-index managed locally. Floating Components are always rendered to document.body</p> <p>This method needs to be called whenever you change something on this component that requires the Component's layout to be recalculated.</p> <p>Enable the component</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Ensures that this component is attached to <code>document.body</code>. If the component was rendered to Ext.getDetachedBody, then it will be appended to <code>document.body</code>. Any configured position is also restored.</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Forces this component to redo its componentLayout.</p> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy.</p> <p>Retrieves the top level element representing this component.</p> <p>Gets the current height of the component's underlying element.</p> <p>Retrieves the id of this component. Will autogenerate an id if one has not already been set.</p> <p>This function takes the position argument passed to onRender and returns a DOM element that you can use in the insertBefore.</p> <p>Gets the <a href="#!/api/Ext.ComponentLoader" rel="Ext.ComponentLoader" class="docClass">Ext.ComponentLoader</a> for this Component.</p> <p>Retrieves a plugin by its pluginId which has been bound to this component.</p> <p>Gets the current size of the component's underlying element.</p> <p>Returns an object that describes how this component's width and height is managed. These objects are shared and should not be modified.</p> <p>The supplied default state gathering method for the AbstractComponent class.</p> <p>This method returns dimension settings such as <code>flex</code>, <code>anchor</code>, <code>width</code> and <code>height</code> along with <code>collapsed</code> state.</p> <p>Subclasses which implement more complex state should call the superclass's implementation, and apply their state to the result if this basic state is to be saved.</p> <p>Note that Component state will only be saved if the Component has a <a href="#!/api/Ext.AbstractComponent-cfg-stateId" rel="Ext.AbstractComponent-cfg-stateId" class="docClass">stateId</a> and there as a StateProvider configured for the document.</p> <p>Gets the state id for this object.</p> <p>Gets the current width of the component's underlying element.</p> <p>Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); alert(t.getXTypes()); // alerts 'component/field/textfield' </code></pre> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Checks if the specified CSS class exists on this element's DOM node.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Checks if there is currently a specified uiCls</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Tests whether this Component matches the selector string.</p> <p>Determines whether this component is the descendant of a particular container.</p> <p>Method to determine whether this Component is currently disabled.</p> <p>Method to determine whether this Component is draggable.</p> <p>Method to determine whether this Component is droppable.</p> <p>Method to determine whether this Component is floating.</p> <p>Method to determine whether this Component is currently set to hidden.</p> <p>Determines whether this Component is the root of a layout. This returns <code>true</code> if this component can run its layout without assistance from or impact on its owner. If this component cannot run its layout given these restrictions, <code>false</code> is returned and its owner will be considered as the next candidate for the layout root.</p> <p>Setting the <a href="#!/api/Ext.AbstractComponent-property-_isLayoutRoot" rel="Ext.AbstractComponent-property-_isLayoutRoot" class="docClass">_isLayoutRoot</a> property to <code>true</code> causes this method to always return <code>true</code>. This may be useful when updating a layout of a Container which shrink wraps content, and you know that it will not change size, and so can safely be the topmost participant in the layout run.</p> <p>Returns true if layout is suspended for this component. This can come from direct suspension of this component's layout activity (suspendLayouts) or if one of this component's containers is suspended.</p> <p>Returns true if this component is visible.</p> <p>Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended from the xtype (default) or whether it is directly of the xtype specified (shallow = true).</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); var isText = t.isXType('textfield'); // true var isBoxSubclass = t.isXType('field'); // true, descended from <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> var isBoxInstance = t.isXType('field', true); // false, not a direct <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> instance </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Returns the next node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextSibling" rel="Ext.AbstractComponent-method-nextSibling" class="docClass">nextSibling</a>.</p> <p>Returns the next sibling of this Component.</p> <p>Optionally selects the next sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>next()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextNode" rel="Ext.AbstractComponent-method-nextNode" class="docClass">nextNode</a></p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Template method called when this Component's DOM structure is created.</p> <p>At this point, this Component's (And all descendants') DOM structure <i>exists</i> but it has not been layed out (positioned and sized).</p> <p>Subclasses which override this to gain access to the structure at render time should call the parent class's method before attempting to access any child elements of the Component.</p> <p>Returns the previous node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree in reverse order to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousSibling" rel="Ext.AbstractComponent-method-previousSibling" class="docClass">previousSibling</a>.</p> <p>Returns the previous sibling of this Component.</p> <p>Optionally selects the previous sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>prev()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousNode" rel="Ext.AbstractComponent-method-previousNode" class="docClass">previousNode</a></p> <p>Called by Component#doAutoRender</p> <p>Register a Container configured <code>floating: true</code> with this Component's <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a>.</p> <p>Components added in ths way will not participate in any layout, but will be rendered upon first show in the way that <a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Window</a>s are.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes items in the childEls array based on the return value of a supplied test function. The function is called with a entry in childEls and if the test function return true, that entry is removed. If false, that entry is kept.</p> <p>Removes a CSS class from the top level element representing this component.</p> <p>Removes a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-removeUIClsFromElement" rel="Ext.AbstractComponent-method-removeUIClsFromElement" class="docClass">removeUIClsFromElement</a> and removes it from all elements of this component.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Method which removes a specified UI + uiCls from the components element. The cls which is added to the element will be: <code>this.baseCls + '-' + ui</code></p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Conditionally saves a single property from this object to the given state object. The idea is to only save state which has changed from the initial state so that current software settings do not override future software settings. Only those values that are user-changed state should be saved.</p> <p>Ensures that all effects queued after sequenceFx is called on this object are run in sequence. This is the opposite of <a href="#!/api/Ext.util.Animate-method-syncFx" rel="Ext.util.Animate-method-syncFx" class="docClass">syncFx</a>.</p> <p>Enable or disable the component.</p> <p>Sets the dock position of this component in its parent panel. Note that this only has effect if this item is part of the dockedItems collection of a parent that has a DockLayout (note that any Panel has a DockLayout by default)</p> <p>Sets the height of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>Sets the left and top of the component. To set the page XY position instead, use setPagePosition. This method fires the <a href="#!/api/Ext.AbstractComponent-event-move" rel="Ext.AbstractComponent-event-move" class="docClass">move</a> event.</p> <p>Sets the width and height of this Component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event. This method can accept either width and height as separate arguments, or you can pass a size object like <code>{width:10, height:20}</code>.</p> <p>Sets the UI for the component. This will remove any existing UIs on the component. It will also loop through any uiCls set on the component and rename them so they include the new UI</p> <p>Convenience function to hide or show this component by boolean.</p> <p>Sets the width of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Ensures that all effects queued after syncFx is called on this object are run concurrently. This is the opposite of <a href="#!/api/Ext.util.Animate-method-sequenceFx" rel="Ext.util.Animate-method-sequenceFx" class="docClass">sequenceFx</a>.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Walks up the <code>ownerCt</code> axis looking for an ancestor Container which matches the passed simple selector.</p> <p>Example:</p> <pre><code>var owningTabPanel = grid.up('tabpanel'); </code></pre> <p>Update the content area of a component.</p> <p>Updates this component's layout. If this update effects this components <a href="#!/api/Ext.AbstractComponent-property-ownerCt" rel="Ext.AbstractComponent-property-ownerCt" class="docClass">ownerCt</a>, that component's <code>updateLayout</code> method will be called to perform the layout instead. Otherwise, just this component (and its child items) will layout.</p> <p>Contains all of the items currently managed</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Creates and returns an instance of whatever this manager manages, based on the supplied type and config object.</p> <p>Executes the specified function once for each item in the collection.</p> <p>Returns an item by id. For additional details see <a href="#!/api/Ext.util.HashMap-method-get" rel="Ext.util.HashMap-method-get" class="docClass">Ext.util.HashMap.get</a>.</p> <p>Gets the number of items in the collection.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Checks if an item type is registered.</p> <p>Registers a function that will be called when an item with the specified id is added to the manager. This will happen on instantiation.</p> <p>Registers an item to be managed</p> <p>Registers a new item constructor, keyed by a type key.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Unregisters an item by removing it from this manager</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>The destroy method is invoked by the owning Component at the time the Component is being destroyed.</p> <p>The supplied implementation is empty. Subclasses should perform plugin cleanup in their own implementation of this method.</p> <p>The base implementation just sets the plugin's <code>disabled</code> flag to <code>true</code></p> <p>Plugin subclasses which need more complex processing may implement an overriding implementation.</p> <p>The base implementation just sets the plugin's <code>disabled</code> flag to <code>false</code></p> <p>Plugin subclasses which need more complex processing may implement an overriding implementation.</p> <p>The init method is invoked after initComponent method has been run for the client Component.</p> <p>The supplied implementation is empty. Subclasses should perform plugin initialization, and set up bidirectional links between the plugin and its client Component in their own implementation of this method.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Creates new Action.</p> <p>Config object.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Disables all components configured by this Action.</p> <p>Executes the specified function once for each Component currently tied to this Action. The function passed in should accept a single argument that will be an object that supports the basic Action config/method interface.</p> <p>Enables all components configured by this Action.</p> <p>Executes this Action manually using the handler function specified in the original config object or the handler function set with <a href="#!/api/Ext.Action-method-setHandler" rel="Ext.Action-method-setHandler" class="docClass">setHandler</a>. Any arguments passed to this function will be passed on to the handler function.</p> <p>Gets the icon CSS class currently used by all components configured by this Action.</p> <p>Gets the text currently displayed by all components configured by this Action.</p> <p>Hides all components configured by this Action.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Returns true if the components using this Action are currently disabled, else returns false.</p> <p>Returns true if the components configured by this Action are currently hidden, else returns false.</p> <p>Sets the disabled state of all components configured by this Action. Shortcut method for <a href="#!/api/Ext.Action-method-enable" rel="Ext.Action-method-enable" class="docClass">enable</a> and <a href="#!/api/Ext.Action-method-disable" rel="Ext.Action-method-disable" class="docClass">disable</a>.</p> <p>Sets the function that will be called by each Component using this action when its primary event is triggered.</p> <p>Sets the hidden state of all components configured by this Action. Shortcut method for <code><a href="#!/api/Ext.Action-method-hide" rel="Ext.Action-method-hide" class="docClass">hide</a></code> and <code><a href="#!/api/Ext.Action-method-show" rel="Ext.Action-method-show" class="docClass">show</a></code>.</p> <p>Sets the icon CSS class for all components configured by this Action. The class should supply a background image that will be used as the icon image.</p> <p>Sets the text to be displayed by all components configured by this Action.</p> <p>Shows all components configured by this Action.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Whether a new request should abort any pending requests.</p> <p>An object containing request headers which are added to each request made by this object.</p> <p>True to add a unique cache-buster param to GET requests. Defaults to true.</p> <p>An object containing properties which are used as extra parameters to each request made by this object. Session information and other data that you need to pass with each request are commonly put here.</p> <p>The default HTTP method to be used for requests. Note that this is case-sensitive and should be all caps (if not set but params are present will use <tt>"POST"</tt>, otherwise will use <tt>"GET"</tt>.)</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>The timeout in milliseconds to be used for requests. Defaults to 30000.</p> <p>The default URL to be used for requests to the server. If the server receives all requests through one URL, setting this once is easier than entering it on every request.</p> <p>Aborts an active request.</p> <p>Aborts all active requests</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Determines whether this object has a request outstanding.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Checks if the response status was successful</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Sends an HTTP request to a remote server.</p> <p><strong>Important:</strong> Ajax server requests are asynchronous, and this call will return before the response has been received. Process any returned data in a callback function.</p> <pre><code><a href="#!/api/Ext.Ajax-method-request" rel="Ext.Ajax-method-request" class="docClass">Ext.Ajax.request</a>({ url: 'ajax_demo/sample.json', success: function(response, opts) { var obj = <a href="#!/api/Ext-method-decode" rel="Ext-method-decode" class="docClass">Ext.decode</a>(response.responseText); console.dir(obj); }, failure: function(response, opts) { console.log('server-side failure with status code ' + response.status); } }); </code></pre> <p>To execute a callback function in the correct scope, use the <code>scope</code> option.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Sets various options such as the url, params for the request</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Uploads a form using a hidden iframe.</p> <p>Creates new Application.</p> <p>Config object.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Adds listeners to components selected via <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">Ext.ComponentQuery</a>. Accepts an object containing component paths mapped to a hash of listener functions.</p> <p>In the following example the <code>updateUser</code> function is mapped to to the <code>click</code> event on a button component, which is a child of the <code>useredit</code> component.</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('AM.controller.Users', { init: function() { this.control({ 'useredit button[action=save]': { click: this.updateUser } }); }, updateUser: function(button) { console.log('clicked the Save button'); } }); </code></pre> <p>See <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">Ext.ComponentQuery</a> for more information on component selectors.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Returns instance of a <a href="#!/api/Ext.app.Controller" rel="Ext.app.Controller" class="docClass">controller</a> with the given name. When controller doesn't exist yet, it's created.</p> <p>Returns a <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Model</a> class with the given name. A shorthand for using <a href="#!/api/Ext.ModelManager-method-getModel" rel="Ext.ModelManager-method-getModel" class="docClass">Ext.ModelManager.getModel</a>.</p> <p>Returns instance of a <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Store</a> with the given name. When store doesn't exist yet, it's created.</p> <p>Returns a View class with the given name. To create an instance of the view, you can use it like it's used by Application to create the Viewport:</p> <pre><code>this.getView('Viewport').create(); </code></pre> <p>Checks to see if this object has any listeners for a specified event</p> <p>A template method that is called when your application boots. It is called before the <a href="#!/api/Ext.app.Application" rel="Ext.app.Application" class="docClass">Application</a>'s launch function is executed so gives a hook point to run any code before your Viewport is created.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Called automatically when the page has completely loaded. This is an empty function that should be overridden by each application that needs to take action on page load.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>A template method like <a href="#!/api/Ext.app.Controller-method-init" rel="Ext.app.Controller-method-init" class="docClass">init</a>, but called after the viewport is created. This is called after the <a href="#!/api/Ext.app.Application-method-launch" rel="Ext.app.Application-method-launch" class="docClass">launch</a> method of Application is executed.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Creates new Controller.</p> <p>Config object.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Adds listeners to components selected via <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">Ext.ComponentQuery</a>. Accepts an object containing component paths mapped to a hash of listener functions.</p> <p>In the following example the <code>updateUser</code> function is mapped to to the <code>click</code> event on a button component, which is a child of the <code>useredit</code> component.</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('AM.controller.Users', { init: function() { this.control({ 'useredit button[action=save]': { click: this.updateUser } }); }, updateUser: function(button) { console.log('clicked the Save button'); } }); </code></pre> <p>See <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">Ext.ComponentQuery</a> for more information on component selectors.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Returns instance of a <a href="#!/api/Ext.app.Controller" rel="Ext.app.Controller" class="docClass">controller</a> with the given name. When controller doesn't exist yet, it's created.</p> <p>Returns a <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Model</a> class with the given name. A shorthand for using <a href="#!/api/Ext.ModelManager-method-getModel" rel="Ext.ModelManager-method-getModel" class="docClass">Ext.ModelManager.getModel</a>.</p> <p>Returns instance of a <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Store</a> with the given name. When store doesn't exist yet, it's created.</p> <p>Returns a View class with the given name. To create an instance of the view, you can use it like it's used by Application to create the Viewport:</p> <pre><code>this.getView('Viewport').create(); </code></pre> <p>Checks to see if this object has any listeners for a specified event</p> <p>A template method that is called when your application boots. It is called before the <a href="#!/api/Ext.app.Application" rel="Ext.app.Application" class="docClass">Application</a>'s launch function is executed so gives a hook point to run any code before your Viewport is created.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>A template method like <a href="#!/api/Ext.app.Controller-method-init" rel="Ext.app.Controller-method-init" class="docClass">init</a>, but called after the viewport is created. This is called after the <a href="#!/api/Ext.app.Application-method-launch" rel="Ext.app.Application-method-launch" class="docClass">launch</a> method of Application is executed.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Filter through an array and remove empty item as defined in <a href="#!/api/Ext-method-isEmpty" rel="Ext-method-isEmpty" class="docClass">Ext.isEmpty</a></p> <p>See <a href="#!/api/Ext.Array-method-filter" rel="Ext.Array-method-filter" class="docClass">filter</a></p> <p>Clone a flat array without referencing the previous one. Note that this is different from <a href="#!/api/Ext-method-clone" rel="Ext-method-clone" class="docClass">Ext.clone</a> since it doesn't handle recursive cloning. It's simply a convenient, easy-to-remember method for Array.prototype.slice.call(array)</p> <p>Checks whether or not the given <code>array</code> contains the specified <code>item</code></p> <p>Perform a set difference A-B by subtracting all items in array B from array A.</p> <p>Iterates an array or an iterable value and invoke the given callback function for each item.</p> <pre><code>var countries = ['Vietnam', 'Singapore', 'United States', 'Russia']; <a href="#!/api/Ext.Array-method-each" rel="Ext.Array-method-each" class="docClass">Ext.Array.each</a>(countries, function(name, index, countriesItSelf) { console.log(name); }); var sum = function() { var sum = 0; <a href="#!/api/Ext.Array-method-each" rel="Ext.Array-method-each" class="docClass">Ext.Array.each</a>(arguments, function(value) { sum += value; }); return sum; }; sum(1, 2, 3); // returns 6 </code></pre> <p>The iteration can be stopped by returning false in the function callback.</p> <pre><code><a href="#!/api/Ext.Array-method-each" rel="Ext.Array-method-each" class="docClass">Ext.Array.each</a>(countries, function(name, index, countriesItSelf) { if (name === 'Singapore') { return false; // break here } }); </code></pre> <p><a href="#!/api/Ext-method-each" rel="Ext-method-each" class="docClass">Ext.each</a> is alias for <a href="#!/api/Ext.Array-method-each" rel="Ext.Array-method-each" class="docClass">Ext.Array.each</a></p> <p>Removes items from an array. This is functionally equivalent to the splice method of Array, but works around bugs in IE8's splice method and does not copy the removed elements in order to return them (because very often they are ignored).</p> <p>Executes the specified function for each array element until the function returns a falsy value. If such an item is found, the function will return false immediately. Otherwise, it will return true.</p> <p>Creates a new array with all of the elements of this array for which the provided filtering function returns true.</p> <p>Recursively flattens into 1-d Array. Injects Arrays inline.</p> <p>Iterates an array and invoke the given callback function for each item. Note that this will simply delegate to the native Array.prototype.forEach method if supported. It doesn't support stopping the iteration by returning false in the callback function like <a href="#!/api/Ext.Array-method-each" rel="Ext.Array-method-each" class="docClass">each</a>. However, performance could be much better in modern browsers comparing with <a href="#!/api/Ext.Array-method-each" rel="Ext.Array-method-each" class="docClass">each</a></p> <p>Converts a value to an array if it's not already an array; returns:</p> <ul> <li>An empty array if given value is <code>undefined</code> or <code>null</code></li> <li>Itself if given value is already an array</li> <li>An array copy if given value is <a href="#!/api/Ext-method-isIterable" rel="Ext-method-isIterable" class="docClass">iterable</a> (arguments, NodeList and alike)</li> <li>An array with one item which is the given value, otherwise</li> </ul> <p>Push an item into the array only if the array doesn't contain it yet</p> <p>Get the index of the provided <code>item</code> in the given <code>array</code>, a supplement for the missing arrayPrototype.indexOf in Internet Explorer.</p> <p>Inserts items in to an array.</p> <p>Merge multiple arrays into one with unique items that exist in all of the arrays.</p> <p>Creates a new array with the results of calling a provided function on every element in this array.</p> <p>Returns the maximum value in the Array.</p> <p>Calculates the mean of all items in the array.</p> <p>Merge multiple arrays into one with unique items.</p> <p><a href="#!/api/Ext.Array-method-union" rel="Ext.Array-method-union" class="docClass">union</a> is alias for <a href="#!/api/Ext.Array-method-merge" rel="Ext.Array-method-merge" class="docClass">merge</a></p> <p>Returns the minimum value in the Array.</p> <p>Plucks the value of a property from each item in the Array. Example:</p> <pre><code><a href="#!/api/Ext.Array-method-pluck" rel="Ext.Array-method-pluck" class="docClass">Ext.Array.pluck</a>(<a href="#!/api/Ext-method-query" rel="Ext-method-query" class="docClass">Ext.query</a>("p"), "className"); // [el1.className, el2.className, ..., elN.className] </code></pre> <p>Removes the specified item from the array if it exists</p> <p>Replaces items in an array. This is functionally equivalent to the splice method of Array, but works around bugs in IE8's splice method and is often more convenient to call because it accepts an array of items to insert rather than use a variadic argument list.</p> <p>Returns a shallow copy of a part of an array. This is equivalent to the native call "Array.prototype.slice.call(array, begin, end)". This is often used when "array" is "arguments" since the arguments object does not supply a slice method but can be the context object to Array.prototype.slice.</p> <p>Executes the specified function for each array element until the function returns a truthy value. If such an item is found, the function will return true immediately. Otherwise, it will return false.</p> <p>Sorts the elements of an Array. By default, this method sorts the elements alphabetically and ascending.</p> <p>Replaces items in an array. This is equivalent to the splice method of Array, but works around bugs in IE8's splice method. The signature is exactly the same as the splice method except that the array is the first argument. All arguments following removeCount are inserted in the array at index.</p> <p>Calculates the sum of all items in the given array.</p> <p>Converts any iterable (numeric indices and a length property) into a true array.</p> <pre><code>function test() { var args = <a href="#!/api/Ext.Array-method-toArray" rel="Ext.Array-method-toArray" class="docClass">Ext.Array.toArray</a>(arguments), fromSecondToLastArgs = <a href="#!/api/Ext.Array-method-toArray" rel="Ext.Array-method-toArray" class="docClass">Ext.Array.toArray</a>(arguments, 1); alert(args.join(' ')); alert(fromSecondToLastArgs.join(' ')); } test('just', 'testing', 'here'); // alerts 'just testing here'; // alerts 'testing here'; <a href="#!/api/Ext.Array-method-toArray" rel="Ext.Array-method-toArray" class="docClass">Ext.Array.toArray</a>(document.getElementsByTagName('div')); // will convert the NodeList into an array <a href="#!/api/Ext.Array-method-toArray" rel="Ext.Array-method-toArray" class="docClass">Ext.Array.toArray</a>('splitted'); // returns ['s', 'p', 'l', 'i', 't', 't', 'e', 'd'] <a href="#!/api/Ext.Array-method-toArray" rel="Ext.Array-method-toArray" class="docClass">Ext.Array.toArray</a>('splitted', 0, 3); // returns ['s', 'p', 'l', 'i'] </code></pre> <p><a href="#!/api/Ext-method-toArray" rel="Ext-method-toArray" class="docClass">Ext.toArray</a> is alias for <a href="#!/api/Ext.Array-method-toArray" rel="Ext.Array-method-toArray" class="docClass">Ext.Array.toArray</a></p> <p>Creates a map (object) keyed by the elements of the given array. The values in the map are the index+1 of the array element. For example:</p> <pre><code> var map = <a href="#!/api/Ext.Array-method-toMap" rel="Ext.Array-method-toMap" class="docClass">Ext.Array.toMap</a>(['a','b','c']); // map = { a: 1, b: 2, c: 3 }; </code></pre> <p>Or a key property can be specified:</p> <pre><code> var map = <a href="#!/api/Ext.Array-method-toMap" rel="Ext.Array-method-toMap" class="docClass">Ext.Array.toMap</a>([ { name: 'a' }, { name: 'b' }, { name: 'c' } ], 'name'); // map = { a: 1, b: 2, c: 3 }; </code></pre> <p>Lastly, a key extractor can be provided:</p> <pre><code> var map = <a href="#!/api/Ext.Array-method-toMap" rel="Ext.Array-method-toMap" class="docClass">Ext.Array.toMap</a>([ { name: 'a' }, { name: 'b' }, { name: 'c' } ], function (obj) { return obj.name.toUpperCase(); }); // map = { A: 1, B: 2, C: 3 }; </code></pre> <p>Merge multiple arrays into one with unique items.</p> <p><a href="#!/api/Ext.Array-method-union" rel="Ext.Array-method-union" class="docClass">union</a> is alias for <a href="#!/api/Ext.Array-method-merge" rel="Ext.Array-method-merge" class="docClass">merge</a></p> <p>Returns a new array with unique items</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Creates new Component.</p> <p>The configuration options may be specified as either:</p> <ul> <li><strong>an element</strong> : it is set as the internal element and its id used as the component id</li> <li><strong>a string</strong> : it is assumed to be the id of an existing element and is used as the component id</li> <li><strong>anything else</strong> : it is assumed to be a standard config object and is applied to the component</li> </ul> <p>Setting this property to <code>true</code> causes the <a href="#!/api/Ext.AbstractComponent-method-isLayoutRoot" rel="Ext.AbstractComponent-method-isLayoutRoot" class="docClass">isLayoutRoot</a> method to return <code>true</code> and stop the search for the top-most component for a layout.</p> <p>True if this button is disabled.</p> <p>Indicates whether or not the component can be dragged.</p> <p>Only present for <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which were inserted as descendant items of floating Containers.</p> <p>Floating Components that are programatically <a href="#!/api/Ext.Component-event-render" rel="Ext.Component-event-render" class="docClass">rendered</a> will not have a <code>floatParent</code> property.</p> <p>For <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which are child items of a Container, the floatParent will be the floating ancestor Container which is responsible for the base z-index value of all its floating descendants. It provides a <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a> which provides z-indexing services for all its descendant floating Components.</p> <p>For example, the dropdown <a href="#!/api/Ext.view.BoundList" rel="Ext.view.BoundList" class="docClass">BoundList</a> of a ComboBox which is in a Window will have the Window as its <code>floatParent</code></p> <p>See <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> and <a href="#!/api/Ext.Component-property-zIndexManager" rel="Ext.Component-property-zIndexManager" class="docClass">zIndexManager</a></p> <p>Indicates the width of any framing elements which were added within the encapsulating element to provide graphical, rounded borders. See the <a href="#!/api/Ext.AbstractComponent-cfg-frame" rel="Ext.AbstractComponent-cfg-frame" class="docClass">frame</a> config.</p> <p>This is an object containing the frame width in pixels for all four sides of the Component containing the following properties:</p> <p>True if this button is hidden.</p> <p>This is an internal flag that you use when creating custom components. By default this is set to true which means that every component gets a mask when its disabled. Components like FieldContainer, FieldSet, Field, Button, Tab override this property to false since they want to implement custom disable logic.</p> <p>The <a href="#!/api/Ext.menu.Menu" rel="Ext.menu.Menu" class="docClass">Menu</a> object associated with this Button when configured with the <a href="#!/api/Ext.button.Button-cfg-menu" rel="Ext.button.Button-cfg-menu" class="docClass">menu</a> config option.</p> <p>This Component's owner <a href="#!/api/Ext.container.Container" rel="Ext.container.Container" class="docClass">Container</a> (is set automatically when this Component is added to a Container).</p> <p><strong>Note</strong>: to access items within the Container see <a href="#!/api/Ext.AbstractComponent-cfg-itemId" rel="Ext.AbstractComponent-cfg-itemId" class="docClass">itemId</a>.</p> <p>True if this button is pressed (only if enableToggle = true).</p> <p>Indicates whether or not the component has been rendered.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>A <a href="#!/api/Ext.Template" rel="Ext.Template" class="docClass">Template</a> used to create the Button's DOM structure.</p> <p>Instances, or subclasses which need a different DOM structure may provide a different template layout in conjunction with an implementation of <a href="#!/api/Ext.button.Button-method-getTemplateArgs" rel="Ext.button.Button-method-getTemplateArgs" class="docClass">getTemplateArgs</a>.</p> <p>Only present for <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components after they have been rendered.</p> <p>A reference to the ZIndexManager which is managing this Component's z-index.</p> <p>The <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a> maintains a stack of floating Component z-indices, and also provides a single modal mask which is insert just beneath the topmost visible modal floating Component.</p> <p>Floating Components may be <a href="#!/api/Ext.Component-method-toFront" rel="Ext.Component-method-toFront" class="docClass">brought to the front</a> or <a href="#!/api/Ext.Component-method-toBack" rel="Ext.Component-method-toBack" class="docClass">sent to the back</a> of the z-index stack.</p> <p>This defaults to the global <a href="#!/api/Ext.WindowManager" rel="Ext.WindowManager" class="docClass">ZIndexManager</a> for floating Components that are programatically <a href="#!/api/Ext.Component-event-render" rel="Ext.Component-event-render" class="docClass">rendered</a>.</p> <p>For <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which are added to a Container, the ZIndexManager is acquired from the first ancestor Container found which is floating, or if not found the global <a href="#!/api/Ext.WindowManager" rel="Ext.WindowManager" class="docClass">ZIndexManager</a> is used.</p> <p>See <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> and <a href="#!/api/Ext.Component-property-floatParent" rel="Ext.Component-property-floatParent" class="docClass">floatParent</a></p> <p>Adds each argument passed to this method to the childEls array.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-addUIClsToElement" rel="Ext.AbstractComponent-method-addUIClsToElement" class="docClass">addUIClsToElement</a> and adds to all elements of this component.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Save a property to the given state object if it is not its default or configured value.</p> <p>Add events that will trigger the state to be saved. If the first argument is an array, each element of that array is the name of a state event. Otherwise, each argument passed to this method is the name of a state event.</p> <p>Method which adds a specified UI + uiCls to the components element. Can be overridden to remove the UI from more than just the components element.</p> <p>Called by the layout system when the Component has been layed out.</p> <p>Aligns this floating Component to the specified element</p> <p>Perform custom animation on this object.</p> <p>This method is applicable to both the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a> class and the <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a> class. It performs animated transitions of certain properties of this object over a specified timeline.</p> <p>The sole parameter is an object which specifies start property values, end property values, and properties which describe the timeline.</p> <h3>Animating an <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a></h3> <p>When animating an Element, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The page X position in pixels.</p></li> <li><p><code>y</code> - The page Y position in pixels</p></li> <li><p><code>left</code> - The element's CSS <code>left</code> value. Units must be supplied.</p></li> <li><p><code>top</code> - The element's CSS <code>top</code> value. Units must be supplied.</p></li> <li><p><code>width</code> - The element's CSS <code>width</code> value. Units must be supplied.</p></li> <li><p><code>height</code> - The element's CSS <code>height</code> value. Units must be supplied.</p></li> <li><p><code>scrollLeft</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>scrollTop</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>opacity</code> - The element's <code>opacity</code> value. This must be a value between <code>0</code> and <code>1</code>.</p></li> </ul> <p><strong>Be aware than animating an Element which is being used by an Ext Component without in some way informing the Component about the changed element state will result in incorrect Component behaviour. This is because the Component will be using the old state of the element. To avoid this problem, it is now possible to directly animate certain properties of Components.</strong></p> <h3>Animating a <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a></h3> <p>When animating a Component, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The Component's page X position in pixels.</p></li> <li><p><code>y</code> - The Component's page Y position in pixels</p></li> <li><p><code>left</code> - The Component's <code>left</code> value in pixels.</p></li> <li><p><code>top</code> - The Component's <code>top</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>dynamic</code> - Specify as true to update the Component's layout (if it is a Container) at every frame of the animation. <em>Use sparingly as laying out on every intermediate size change is an expensive operation.</em></p></li> </ul> <p>For example, to animate a Window to a new size, ensuring that its internal layout, and any shadow is correct:</p> <pre><code>myWindow = <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>', { title: 'Test Component animation', width: 500, height: 300, layout: { type: 'hbox', align: 'stretch' }, items: [{ title: 'Left: 33%', margins: '5 0 5 5', flex: 1 }, { title: 'Left: 66%', margins: '5 5 5 5', flex: 2 }] }); myWindow.show(); myWindow.header.el.on('click', function() { myWindow.animate({ to: { width: (myWindow.getWidth() == 500) ? 700 : 500, height: (myWindow.getHeight() == 300) ? 400 : 300, } }); }); </code></pre> <p>For performance reasons, by default, the internal layout is only updated when the Window reaches its final <code>"to"</code> size. If dynamic updating of the Window's child Components is required, then configure the animation with <code>dynamic: true</code> and the two child items will maintain their proportions during the animation.</p> <p>Applies the state to the object. This should be overridden in subclasses to do more complex state operations. By default it applies the state properties onto the current object.</p> <p>Utility wrapper that suspends layouts of all components for the duration of a given function.</p> <p>Occurs before componentLayout is run. Returning false from this method will prevent the componentLayout from being executed.</p> <p>Bubbles up the component/container heirarchy, calling the specified function with each component. The scope (<em>this</em>) of function call will be the scope provided or the current component. The arguments to the function will be the args provided or the current component. If the function returns false at any point, the bubble is stopped.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Center this Component in its container.</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Clone the current component using the original config values passed into this instance by default.</p> <p>Ensures that the plugins array contains fully constructed plugin instances. This converts any configs into their appropriate instances.</p> <p>Destroys the Component.</p> <p>Disable the component.</p> <p>Handles autoRender. Floating Components may have an ownerCt. If they are asking to be constrained, constrain them within that ownerCt, and have their z-index managed locally. Floating Components are always rendered to document.body</p> <p>This method needs to be called whenever you change something on this component that requires the Component's layout to be recalculated.</p> <p>Moves this floating Component into a constrain region.</p> <p>By default, this Component is constrained to be within the container it was added to, or the element it was rendered to.</p> <p>An alternative constraint may be passed.</p> <p>Enable the component</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Ensures that this component is attached to <code>document.body</code>. If the component was rendered to Ext.getDetachedBody, then it will be appended to <code>document.body</code>. Any configured position is also restored.</p> <p>Find a container above this component at any level by a custom function. If the passed function returns true, the container will be returned.</p> <p>Find a container above this component at any level by xtype or class</p> <p>See also the <a href="#!/api/Ext.Component-method-up" rel="Ext.Component-method-up" class="docClass">up</a> method.</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Try to focus this component.</p> <p>Forces this component to redo its componentLayout.</p> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Gets the current box measurements of the component's underlying element.</p> <p>Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy.</p> <p>Retrieves the top level element representing this component.</p> <p>Gets the current height of the component's underlying element.</p> <p>Retrieves the id of this component. Will autogenerate an id if one has not already been set.</p> <p>This function takes the position argument passed to onRender and returns a DOM element that you can use in the insertBefore.</p> <p>Gets the <a href="#!/api/Ext.ComponentLoader" rel="Ext.ComponentLoader" class="docClass">Ext.ComponentLoader</a> for this Component.</p> <p>Retrieves a plugin by its pluginId which has been bound to this component.</p> <p>Gets the current XY position of the component's underlying element.</p> <p>Gets the current size of the component's underlying element.</p> <p>Returns an object that describes how this component's width and height is managed. These objects are shared and should not be modified.</p> <p>The supplied default state gathering method for the AbstractComponent class.</p> <p>This method returns dimension settings such as <code>flex</code>, <code>anchor</code>, <code>width</code> and <code>height</code> along with <code>collapsed</code> state.</p> <p>Subclasses which implement more complex state should call the superclass's implementation, and apply their state to the result if this basic state is to be saved.</p> <p>Note that Component state will only be saved if the Component has a <a href="#!/api/Ext.AbstractComponent-cfg-stateId" rel="Ext.AbstractComponent-cfg-stateId" class="docClass">stateId</a> and there as a StateProvider configured for the document.</p> <p>Gets the state id for this object.</p> <p>This method returns an object which provides substitution parameters for the <a href="#!/api/Ext.button.Button-cfg-renderTpl" rel="Ext.button.Button-cfg-renderTpl" class="docClass">XTemplate</a> used to create this Button's DOM structure.</p> <p>Instances or subclasses which use a different Template to create a different DOM structure may need to provide their own implementation of this method.</p> <p>Gets the text for this Button</p> <p>Gets the current width of the component's underlying element.</p> <p>Gets the xtype for this component as registered with <a href="#!/api/Ext.ComponentManager" rel="Ext.ComponentManager" class="docClass">Ext.ComponentManager</a>. For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header. Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); alert(t.getXType()); // alerts 'textfield' </code></pre> <p>Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); alert(t.getXTypes()); // alerts 'component/field/textfield' </code></pre> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Checks if the specified CSS class exists on this element's DOM node.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Checks if there is currently a specified uiCls</p> <p>Returns true if the button has a menu and it is visible</p> <p>Hides this Component, setting it to invisible using the configured <a href="#!/api/Ext.Component-cfg-hideMode" rel="Ext.Component-cfg-hideMode" class="docClass">hideMode</a>.</p> <p>Hides this button's menu (if it has one)</p> <p>The initComponent template method is an important initialization step for a Component. It is intended to be implemented by each subclass of <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> to provide any needed constructor logic. The initComponent method of the class being created is called first, with each initComponent method up the hierarchy to <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> being called thereafter. This makes it easy to implement and, if needed, override the constructor logic of the Component at any step in the hierarchy.</p> <p>The initComponent method <strong>must</strong> contain a call to <a href="#!/api/Ext.Base-method-callParent" rel="Ext.Base-method-callParent" class="docClass">callParent</a> in order to ensure that the parent class' initComponent method is also called.</p> <p>All config options passed to the constructor are applied to <code>this</code> before initComponent is called, so you can simply access them with <code>this.someOption</code>.</p> <p>The following example demonstrates using a dynamic string for the text of a button at the time of instantiation of the class.</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('DynamicButtonText', { extend: '<a href="#!/api/Ext.button.Button" rel="Ext.button.Button" class="docClass">Ext.button.Button</a>', initComponent: function() { this.text = new Date(); this.renderTo = <a href="#!/api/Ext-method-getBody" rel="Ext-method-getBody" class="docClass">Ext.getBody</a>(); this.callParent(); } }); <a href="#!/api/Ext-method-onReady" rel="Ext-method-onReady" class="docClass">Ext.onReady</a>(function() { <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('DynamicButtonText'); }); </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Tests whether this Component matches the selector string.</p> <p>Determines whether this component is the descendant of a particular container.</p> <p>Method to determine whether this Component is currently disabled.</p> <p>Method to determine whether this Component is draggable.</p> <p>Method to determine whether this Component is droppable.</p> <p>Method to determine whether this Component is floating.</p> <p>Method to determine whether this Component is currently set to hidden.</p> <p>Determines whether this Component is the root of a layout. This returns <code>true</code> if this component can run its layout without assistance from or impact on its owner. If this component cannot run its layout given these restrictions, <code>false</code> is returned and its owner will be considered as the next candidate for the layout root.</p> <p>Setting the <a href="#!/api/Ext.AbstractComponent-property-_isLayoutRoot" rel="Ext.AbstractComponent-property-_isLayoutRoot" class="docClass">_isLayoutRoot</a> property to <code>true</code> causes this method to always return <code>true</code>. This may be useful when updating a layout of a Container which shrink wraps content, and you know that it will not change size, and so can safely be the topmost participant in the layout run.</p> <p>Returns true if layout is suspended for this component. This can come from direct suspension of this component's layout activity (suspendLayouts) or if one of this component's containers is suspended.</p> <p>Returns true if this component is visible.</p> <p>Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended from the xtype (default) or whether it is directly of the xtype specified (shallow = true).</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); var isText = t.isXType('textfield'); // true var isBoxSubclass = t.isXType('field'); // true, descended from <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> var isBoxInstance = t.isXType('field', true); // false, not a direct <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> instance </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Returns the next node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextSibling" rel="Ext.AbstractComponent-method-nextSibling" class="docClass">nextSibling</a>.</p> <p>Returns the next sibling of this Component.</p> <p>Optionally selects the next sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>next()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextNode" rel="Ext.AbstractComponent-method-nextNode" class="docClass">nextNode</a></p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Template method called when this Component's DOM structure is created.</p> <p>At this point, this Component's (And all descendants') DOM structure <i>exists</i> but it has not been layed out (positioned and sized).</p> <p>Subclasses which override this to gain access to the structure at render time should call the parent class's method before attempting to access any child elements of the Component.</p> <p>Returns the previous node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree in reverse order to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousSibling" rel="Ext.AbstractComponent-method-previousSibling" class="docClass">previousSibling</a>.</p> <p>Returns the previous sibling of this Component.</p> <p>Optionally selects the previous sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>prev()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousNode" rel="Ext.AbstractComponent-method-previousNode" class="docClass">previousNode</a></p> <p>Called by Component#doAutoRender</p> <p>Register a Container configured <code>floating: true</code> with this Component's <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a>.</p> <p>Components added in ths way will not participate in any layout, but will be rendered upon first show in the way that <a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Window</a>s are.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes items in the childEls array based on the return value of a supplied test function. The function is called with a entry in childEls and if the test function return true, that entry is removed. If false, that entry is kept.</p> <p>Removes a CSS class from the top level element representing this component.</p> <p>Removes a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-removeUIClsFromElement" rel="Ext.AbstractComponent-method-removeUIClsFromElement" class="docClass">removeUIClsFromElement</a> and removes it from all elements of this component.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Method which removes a specified UI + uiCls from the components element. The cls which is added to the element will be: <code>this.baseCls + '-' + ui</code></p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Conditionally saves a single property from this object to the given state object. The idea is to only save state which has changed from the initial state so that current software settings do not override future software settings. Only those values that are user-changed state should be saved.</p> <p>Scrolls this Component's target element by the passed delta values, optionally animating.</p> <p>All of the following are equivalent:</p> <pre><code> comp.scrollBy(10, 10, true); comp.scrollBy([10, 10], true); comp.scrollBy({ x: 10, y: 10 }, true); </code></pre> <p>Ensures that all effects queued after sequenceFx is called on this object are run in sequence. This is the opposite of <a href="#!/api/Ext.util.Animate-method-syncFx" rel="Ext.util.Animate-method-syncFx" class="docClass">syncFx</a>.</p> <p>This method is called internally by <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">Ext.ZIndexManager</a> to signal that a floating Component has either been moved to the top of its zIndex stack, or pushed from the top of its zIndex stack.</p> <p>If a <em>Window</em> is superceded by another Window, deactivating it hides its shadow.</p> <p>This method also fires the <a href="#!/api/Ext.Component-event-activate" rel="Ext.Component-event-activate" class="docClass">activate</a> or <a href="#!/api/Ext.Component-event-deactivate" rel="Ext.Component-event-deactivate" class="docClass">deactivate</a> event depending on which action occurred.</p> <p>Sets the overflow on the content element of the component.</p> <p>Enable or disable the component.</p> <p>Sets the dock position of this component in its parent panel. Note that this only has effect if this item is part of the dockedItems collection of a parent that has a DockLayout (note that any Panel has a DockLayout by default)</p> <p>Assigns this Button's click handler</p> <p>Sets the height of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>Sets the background image (inline style) of the button. This method also changes the value of the <a href="#!/api/Ext.button.Button-cfg-icon" rel="Ext.button.Button-cfg-icon" class="docClass">icon</a> config internally.</p> <p>Sets the CSS class that provides a background image to use as the button's icon. This method also changes the value of the <a href="#!/api/Ext.button.Button-cfg-iconCls" rel="Ext.button.Button-cfg-iconCls" class="docClass">iconCls</a> config internally.</p> <p>This method allows you to show or hide a LoadMask on top of this component.</p> <p>Sets the overflow x/y on the content element of the component. The x/y overflow values can be any valid CSS overflow (e.g., 'auto' or 'scroll'). By default, the value is 'hidden'. Passing null for one of the values will erase the inline style. Passing <code>undefined</code> will preserve the current value.</p> <p>Sets the page XY position of the component. To set the left and top instead, use <a href="#!/api/Ext.Component-method-setPosition" rel="Ext.Component-method-setPosition" class="docClass">setPosition</a>. This method fires the <a href="#!/api/Ext.Component-event-move" rel="Ext.Component-event-move" class="docClass">move</a> event.</p> <p>Sets the href of the link dynamically according to the params passed, and any <a href="#!/api/Ext.button.Button-cfg-baseParams" rel="Ext.button.Button-cfg-baseParams" class="docClass">baseParams</a> configured.</p> <p><strong>Only valid if the Button was originally configured with a <a href="#!/api/Ext.button.Button-cfg-href" rel="Ext.button.Button-cfg-href" class="docClass">href</a></strong></p> <p>Sets the left and top of the component. To set the page XY position instead, use setPagePosition. This method fires the <a href="#!/api/Ext.AbstractComponent-event-move" rel="Ext.AbstractComponent-event-move" class="docClass">move</a> event.</p> <p>Method to change the scale of the button. See <a href="#!/api/Ext.button.Button-cfg-scale" rel="Ext.button.Button-cfg-scale" class="docClass">scale</a> for allowed configurations.</p> <p>Sets the width and height of this Component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event. This method can accept either width and height as separate arguments, or you can pass a size object like <code>{width:10, height:20}</code>.</p> <p>Sets this Button's text</p> <p>Sets the text alignment for this button.</p> <p>Sets the tooltip for this Button.</p> <p>Sets the UI for the component. This will remove any existing UIs on the component. It will also loop through any uiCls set on the component and rename them so they include the new UI</p> <p>Convenience function to hide or show this component by boolean.</p> <p>Sets the width of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>Shows this Component, rendering it first if <a href="#!/api/Ext.Component-cfg-autoRender" rel="Ext.Component-cfg-autoRender" class="docClass">autoRender</a> or <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> are <code>true</code>.</p> <p>After being shown, a <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Component (such as a <a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>), is activated it and brought to the front of its <a href="#!/api/Ext.Component-property-zIndexManager" rel="Ext.Component-property-zIndexManager" class="docClass">z-index stack</a>.</p> <p>Displays component at specific xy position. A floating component (like a menu) is positioned relative to its ownerCt if any. Useful for popping up a context menu:</p> <pre><code>listeners: { itemcontextmenu: function(view, record, item, index, event, options) { <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.menu.Menu" rel="Ext.menu.Menu" class="docClass">Ext.menu.Menu</a>', { width: 100, height: 100, margin: '0 0 10 0', items: [{ text: 'regular item 1' },{ text: 'regular item 2' },{ text: 'regular item 3' }] }).showAt(event.getXY()); } } </code></pre> <p>Shows this button's menu (if it has one)</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Ensures that all effects queued after syncFx is called on this object are run concurrently. This is the opposite of <a href="#!/api/Ext.util.Animate-method-sequenceFx" rel="Ext.util.Animate-method-sequenceFx" class="docClass">sequenceFx</a>.</p> <p>Sends this Component to the back of (lower z-index than) any other visible windows</p> <p>Brings this floating Component to the front of any other visible, floating Components managed by the same <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a></p> <p>If this Component is modal, inserts the modal mask just below this Component in the z-index stack.</p> <p>If a state it passed, it becomes the pressed state otherwise the current state is toggled.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Walks up the <code>ownerCt</code> axis looking for an ancestor Container which matches the passed simple selector.</p> <p>Example:</p> <pre><code>var owningTabPanel = grid.up('tabpanel'); </code></pre> <p>Update the content area of a component.</p> <p>Sets the current box measurements of the component's underlying element.</p> <p>Updates this component's layout. If this update effects this components <a href="#!/api/Ext.AbstractComponent-property-ownerCt" rel="Ext.AbstractComponent-property-ownerCt" class="docClass">ownerCt</a>, that component's <code>updateLayout</code> method will be called to perform the layout instead. Otherwise, just this component (and its child items) will layout.</p> <p>Creates new Component.</p> <p>The configuration options may be specified as either:</p> <ul> <li><strong>an element</strong> : it is set as the internal element and its id used as the component id</li> <li><strong>a string</strong> : it is assumed to be the id of an existing element and is used as the component id</li> <li><strong>anything else</strong> : it is assumed to be a standard config object and is applied to the component</li> </ul> <p>Setting this property to <code>true</code> causes the <a href="#!/api/Ext.AbstractComponent-method-isLayoutRoot" rel="Ext.AbstractComponent-method-isLayoutRoot" class="docClass">isLayoutRoot</a> method to return <code>true</code> and stop the search for the top-most component for a layout.</p> <p>True if this button is disabled.</p> <p>Indicates whether or not the component can be dragged.</p> <p>Only present for <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which were inserted as descendant items of floating Containers.</p> <p>Floating Components that are programatically <a href="#!/api/Ext.Component-event-render" rel="Ext.Component-event-render" class="docClass">rendered</a> will not have a <code>floatParent</code> property.</p> <p>For <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which are child items of a Container, the floatParent will be the floating ancestor Container which is responsible for the base z-index value of all its floating descendants. It provides a <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a> which provides z-indexing services for all its descendant floating Components.</p> <p>For example, the dropdown <a href="#!/api/Ext.view.BoundList" rel="Ext.view.BoundList" class="docClass">BoundList</a> of a ComboBox which is in a Window will have the Window as its <code>floatParent</code></p> <p>See <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> and <a href="#!/api/Ext.Component-property-zIndexManager" rel="Ext.Component-property-zIndexManager" class="docClass">zIndexManager</a></p> <p>Indicates the width of any framing elements which were added within the encapsulating element to provide graphical, rounded borders. See the <a href="#!/api/Ext.AbstractComponent-cfg-frame" rel="Ext.AbstractComponent-cfg-frame" class="docClass">frame</a> config.</p> <p>This is an object containing the frame width in pixels for all four sides of the Component containing the following properties:</p> <p>True if this button is hidden.</p> <p>This is an internal flag that you use when creating custom components. By default this is set to true which means that every component gets a mask when its disabled. Components like FieldContainer, FieldSet, Field, Button, Tab override this property to false since they want to implement custom disable logic.</p> <p>The <a href="#!/api/Ext.menu.Menu" rel="Ext.menu.Menu" class="docClass">Menu</a> object used to display the <a href="#!/api/Ext.menu.CheckItem" rel="Ext.menu.CheckItem" class="docClass">CheckItems</a> representing the available choices.</p> <p>This Component's owner <a href="#!/api/Ext.container.Container" rel="Ext.container.Container" class="docClass">Container</a> (is set automatically when this Component is added to a Container).</p> <p><strong>Note</strong>: to access items within the Container see <a href="#!/api/Ext.AbstractComponent-cfg-itemId" rel="Ext.AbstractComponent-cfg-itemId" class="docClass">itemId</a>.</p> <p>True if this button is pressed (only if enableToggle = true).</p> <p>Indicates whether or not the component has been rendered.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>A <a href="#!/api/Ext.Template" rel="Ext.Template" class="docClass">Template</a> used to create the Button's DOM structure.</p> <p>Instances, or subclasses which need a different DOM structure may provide a different template layout in conjunction with an implementation of <a href="#!/api/Ext.button.Button-method-getTemplateArgs" rel="Ext.button.Button-method-getTemplateArgs" class="docClass">getTemplateArgs</a>.</p> <p>Only present for <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components after they have been rendered.</p> <p>A reference to the ZIndexManager which is managing this Component's z-index.</p> <p>The <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a> maintains a stack of floating Component z-indices, and also provides a single modal mask which is insert just beneath the topmost visible modal floating Component.</p> <p>Floating Components may be <a href="#!/api/Ext.Component-method-toFront" rel="Ext.Component-method-toFront" class="docClass">brought to the front</a> or <a href="#!/api/Ext.Component-method-toBack" rel="Ext.Component-method-toBack" class="docClass">sent to the back</a> of the z-index stack.</p> <p>This defaults to the global <a href="#!/api/Ext.WindowManager" rel="Ext.WindowManager" class="docClass">ZIndexManager</a> for floating Components that are programatically <a href="#!/api/Ext.Component-event-render" rel="Ext.Component-event-render" class="docClass">rendered</a>.</p> <p>For <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which are added to a Container, the ZIndexManager is acquired from the first ancestor Container found which is floating, or if not found the global <a href="#!/api/Ext.WindowManager" rel="Ext.WindowManager" class="docClass">ZIndexManager</a> is used.</p> <p>See <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> and <a href="#!/api/Ext.Component-property-floatParent" rel="Ext.Component-property-floatParent" class="docClass">floatParent</a></p> <p>Adds each argument passed to this method to the childEls array.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-addUIClsToElement" rel="Ext.AbstractComponent-method-addUIClsToElement" class="docClass">addUIClsToElement</a> and adds to all elements of this component.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Save a property to the given state object if it is not its default or configured value.</p> <p>Add events that will trigger the state to be saved. If the first argument is an array, each element of that array is the name of a state event. Otherwise, each argument passed to this method is the name of a state event.</p> <p>Method which adds a specified UI + uiCls to the components element. Can be overridden to remove the UI from more than just the components element.</p> <p>Called by the layout system when the Component has been layed out.</p> <p>Aligns this floating Component to the specified element</p> <p>Perform custom animation on this object.</p> <p>This method is applicable to both the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a> class and the <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a> class. It performs animated transitions of certain properties of this object over a specified timeline.</p> <p>The sole parameter is an object which specifies start property values, end property values, and properties which describe the timeline.</p> <h3>Animating an <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a></h3> <p>When animating an Element, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The page X position in pixels.</p></li> <li><p><code>y</code> - The page Y position in pixels</p></li> <li><p><code>left</code> - The element's CSS <code>left</code> value. Units must be supplied.</p></li> <li><p><code>top</code> - The element's CSS <code>top</code> value. Units must be supplied.</p></li> <li><p><code>width</code> - The element's CSS <code>width</code> value. Units must be supplied.</p></li> <li><p><code>height</code> - The element's CSS <code>height</code> value. Units must be supplied.</p></li> <li><p><code>scrollLeft</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>scrollTop</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>opacity</code> - The element's <code>opacity</code> value. This must be a value between <code>0</code> and <code>1</code>.</p></li> </ul> <p><strong>Be aware than animating an Element which is being used by an Ext Component without in some way informing the Component about the changed element state will result in incorrect Component behaviour. This is because the Component will be using the old state of the element. To avoid this problem, it is now possible to directly animate certain properties of Components.</strong></p> <h3>Animating a <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a></h3> <p>When animating a Component, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The Component's page X position in pixels.</p></li> <li><p><code>y</code> - The Component's page Y position in pixels</p></li> <li><p><code>left</code> - The Component's <code>left</code> value in pixels.</p></li> <li><p><code>top</code> - The Component's <code>top</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>dynamic</code> - Specify as true to update the Component's layout (if it is a Container) at every frame of the animation. <em>Use sparingly as laying out on every intermediate size change is an expensive operation.</em></p></li> </ul> <p>For example, to animate a Window to a new size, ensuring that its internal layout, and any shadow is correct:</p> <pre><code>myWindow = <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>', { title: 'Test Component animation', width: 500, height: 300, layout: { type: 'hbox', align: 'stretch' }, items: [{ title: 'Left: 33%', margins: '5 0 5 5', flex: 1 }, { title: 'Left: 66%', margins: '5 5 5 5', flex: 2 }] }); myWindow.show(); myWindow.header.el.on('click', function() { myWindow.animate({ to: { width: (myWindow.getWidth() == 500) ? 700 : 500, height: (myWindow.getHeight() == 300) ? 400 : 300, } }); }); </code></pre> <p>For performance reasons, by default, the internal layout is only updated when the Window reaches its final <code>"to"</code> size. If dynamic updating of the Window's child Components is required, then configure the animation with <code>dynamic: true</code> and the two child items will maintain their proportions during the animation.</p> <p>Applies the state to the object. This should be overridden in subclasses to do more complex state operations. By default it applies the state properties onto the current object.</p> <p>Utility wrapper that suspends layouts of all components for the duration of a given function.</p> <p>Occurs before componentLayout is run. Returning false from this method will prevent the componentLayout from being executed.</p> <p>Bubbles up the component/container heirarchy, calling the specified function with each component. The scope (<em>this</em>) of function call will be the scope provided or the current component. The arguments to the function will be the args provided or the current component. If the function returns false at any point, the bubble is stopped.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Center this Component in its container.</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Clone the current component using the original config values passed into this instance by default.</p> <p>Ensures that the plugins array contains fully constructed plugin instances. This converts any configs into their appropriate instances.</p> <p>Destroys the Component.</p> <p>Disable the component.</p> <p>Handles autoRender. Floating Components may have an ownerCt. If they are asking to be constrained, constrain them within that ownerCt, and have their z-index managed locally. Floating Components are always rendered to document.body</p> <p>This method needs to be called whenever you change something on this component that requires the Component's layout to be recalculated.</p> <p>Moves this floating Component into a constrain region.</p> <p>By default, this Component is constrained to be within the container it was added to, or the element it was rendered to.</p> <p>An alternative constraint may be passed.</p> <p>Enable the component</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Ensures that this component is attached to <code>document.body</code>. If the component was rendered to Ext.getDetachedBody, then it will be appended to <code>document.body</code>. Any configured position is also restored.</p> <p>Find a container above this component at any level by a custom function. If the passed function returns true, the container will be returned.</p> <p>Find a container above this component at any level by xtype or class</p> <p>See also the <a href="#!/api/Ext.Component-method-up" rel="Ext.Component-method-up" class="docClass">up</a> method.</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Try to focus this component.</p> <p>Forces this component to redo its componentLayout.</p> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Gets the currently active menu item.</p> <p>Gets the current box measurements of the component's underlying element.</p> <p>Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy.</p> <p>Retrieves the top level element representing this component.</p> <p>Gets the current height of the component's underlying element.</p> <p>Retrieves the id of this component. Will autogenerate an id if one has not already been set.</p> <p>This function takes the position argument passed to onRender and returns a DOM element that you can use in the insertBefore.</p> <p>Gets the <a href="#!/api/Ext.ComponentLoader" rel="Ext.ComponentLoader" class="docClass">Ext.ComponentLoader</a> for this Component.</p> <p>Retrieves a plugin by its pluginId which has been bound to this component.</p> <p>Gets the current XY position of the component's underlying element.</p> <p>Gets the current size of the component's underlying element.</p> <p>Returns an object that describes how this component's width and height is managed. These objects are shared and should not be modified.</p> <p>The supplied default state gathering method for the AbstractComponent class.</p> <p>This method returns dimension settings such as <code>flex</code>, <code>anchor</code>, <code>width</code> and <code>height</code> along with <code>collapsed</code> state.</p> <p>Subclasses which implement more complex state should call the superclass's implementation, and apply their state to the result if this basic state is to be saved.</p> <p>Note that Component state will only be saved if the Component has a <a href="#!/api/Ext.AbstractComponent-cfg-stateId" rel="Ext.AbstractComponent-cfg-stateId" class="docClass">stateId</a> and there as a StateProvider configured for the document.</p> <p>Gets the state id for this object.</p> <p>This method returns an object which provides substitution parameters for the <a href="#!/api/Ext.button.Button-cfg-renderTpl" rel="Ext.button.Button-cfg-renderTpl" class="docClass">XTemplate</a> used to create this Button's DOM structure.</p> <p>Instances or subclasses which use a different Template to create a different DOM structure may need to provide their own implementation of this method.</p> <p>Gets the text for this Button</p> <p>Gets the current width of the component's underlying element.</p> <p>Gets the xtype for this component as registered with <a href="#!/api/Ext.ComponentManager" rel="Ext.ComponentManager" class="docClass">Ext.ComponentManager</a>. For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header. Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); alert(t.getXType()); // alerts 'textfield' </code></pre> <p>Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); alert(t.getXTypes()); // alerts 'component/field/textfield' </code></pre> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Checks if the specified CSS class exists on this element's DOM node.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Checks if there is currently a specified uiCls</p> <p>Returns true if the button has a menu and it is visible</p> <p>Hides this Component, setting it to invisible using the configured <a href="#!/api/Ext.Component-cfg-hideMode" rel="Ext.Component-cfg-hideMode" class="docClass">hideMode</a>.</p> <p>Hides this button's menu (if it has one)</p> <p>The initComponent template method is an important initialization step for a Component. It is intended to be implemented by each subclass of <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> to provide any needed constructor logic. The initComponent method of the class being created is called first, with each initComponent method up the hierarchy to <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> being called thereafter. This makes it easy to implement and, if needed, override the constructor logic of the Component at any step in the hierarchy.</p> <p>The initComponent method <strong>must</strong> contain a call to <a href="#!/api/Ext.Base-method-callParent" rel="Ext.Base-method-callParent" class="docClass">callParent</a> in order to ensure that the parent class' initComponent method is also called.</p> <p>All config options passed to the constructor are applied to <code>this</code> before initComponent is called, so you can simply access them with <code>this.someOption</code>.</p> <p>The following example demonstrates using a dynamic string for the text of a button at the time of instantiation of the class.</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('DynamicButtonText', { extend: '<a href="#!/api/Ext.button.Button" rel="Ext.button.Button" class="docClass">Ext.button.Button</a>', initComponent: function() { this.text = new Date(); this.renderTo = <a href="#!/api/Ext-method-getBody" rel="Ext-method-getBody" class="docClass">Ext.getBody</a>(); this.callParent(); } }); <a href="#!/api/Ext-method-onReady" rel="Ext-method-onReady" class="docClass">Ext.onReady</a>(function() { <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('DynamicButtonText'); }); </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Tests whether this Component matches the selector string.</p> <p>Determines whether this component is the descendant of a particular container.</p> <p>Method to determine whether this Component is currently disabled.</p> <p>Method to determine whether this Component is draggable.</p> <p>Method to determine whether this Component is droppable.</p> <p>Method to determine whether this Component is floating.</p> <p>Method to determine whether this Component is currently set to hidden.</p> <p>Determines whether this Component is the root of a layout. This returns <code>true</code> if this component can run its layout without assistance from or impact on its owner. If this component cannot run its layout given these restrictions, <code>false</code> is returned and its owner will be considered as the next candidate for the layout root.</p> <p>Setting the <a href="#!/api/Ext.AbstractComponent-property-_isLayoutRoot" rel="Ext.AbstractComponent-property-_isLayoutRoot" class="docClass">_isLayoutRoot</a> property to <code>true</code> causes this method to always return <code>true</code>. This may be useful when updating a layout of a Container which shrink wraps content, and you know that it will not change size, and so can safely be the topmost participant in the layout run.</p> <p>Returns true if layout is suspended for this component. This can come from direct suspension of this component's layout activity (suspendLayouts) or if one of this component's containers is suspended.</p> <p>Returns true if this component is visible.</p> <p>Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended from the xtype (default) or whether it is directly of the xtype specified (shallow = true).</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); var isText = t.isXType('textfield'); // true var isBoxSubclass = t.isXType('field'); // true, descended from <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> var isBoxInstance = t.isXType('field', true); // false, not a direct <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> instance </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Returns the next node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextSibling" rel="Ext.AbstractComponent-method-nextSibling" class="docClass">nextSibling</a>.</p> <p>Returns the next sibling of this Component.</p> <p>Optionally selects the next sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>next()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextNode" rel="Ext.AbstractComponent-method-nextNode" class="docClass">nextNode</a></p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Template method called when this Component's DOM structure is created.</p> <p>At this point, this Component's (And all descendants') DOM structure <i>exists</i> but it has not been layed out (positioned and sized).</p> <p>Subclasses which override this to gain access to the structure at render time should call the parent class's method before attempting to access any child elements of the Component.</p> <p>Returns the previous node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree in reverse order to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousSibling" rel="Ext.AbstractComponent-method-previousSibling" class="docClass">previousSibling</a>.</p> <p>Returns the previous sibling of this Component.</p> <p>Optionally selects the previous sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>prev()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousNode" rel="Ext.AbstractComponent-method-previousNode" class="docClass">previousNode</a></p> <p>Called by Component#doAutoRender</p> <p>Register a Container configured <code>floating: true</code> with this Component's <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a>.</p> <p>Components added in ths way will not participate in any layout, but will be rendered upon first show in the way that <a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Window</a>s are.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes items in the childEls array based on the return value of a supplied test function. The function is called with a entry in childEls and if the test function return true, that entry is removed. If false, that entry is kept.</p> <p>Removes a CSS class from the top level element representing this component.</p> <p>Removes a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-removeUIClsFromElement" rel="Ext.AbstractComponent-method-removeUIClsFromElement" class="docClass">removeUIClsFromElement</a> and removes it from all elements of this component.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Method which removes a specified UI + uiCls from the components element. The cls which is added to the element will be: <code>this.baseCls + '-' + ui</code></p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Conditionally saves a single property from this object to the given state object. The idea is to only save state which has changed from the initial state so that current software settings do not override future software settings. Only those values that are user-changed state should be saved.</p> <p>Scrolls this Component's target element by the passed delta values, optionally animating.</p> <p>All of the following are equivalent:</p> <pre><code> comp.scrollBy(10, 10, true); comp.scrollBy([10, 10], true); comp.scrollBy({ x: 10, y: 10 }, true); </code></pre> <p>Ensures that all effects queued after sequenceFx is called on this object are run in sequence. This is the opposite of <a href="#!/api/Ext.util.Animate-method-syncFx" rel="Ext.util.Animate-method-syncFx" class="docClass">syncFx</a>.</p> <p>This method is called internally by <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">Ext.ZIndexManager</a> to signal that a floating Component has either been moved to the top of its zIndex stack, or pushed from the top of its zIndex stack.</p> <p>If a <em>Window</em> is superceded by another Window, deactivating it hides its shadow.</p> <p>This method also fires the <a href="#!/api/Ext.Component-event-activate" rel="Ext.Component-event-activate" class="docClass">activate</a> or <a href="#!/api/Ext.Component-event-deactivate" rel="Ext.Component-event-deactivate" class="docClass">deactivate</a> event depending on which action occurred.</p> <p>Sets the button's active menu item.</p> <p>Sets this button's arrow click handler.</p> <p>Sets the overflow on the content element of the component.</p> <p>Enable or disable the component.</p> <p>Sets the dock position of this component in its parent panel. Note that this only has effect if this item is part of the dockedItems collection of a parent that has a DockLayout (note that any Panel has a DockLayout by default)</p> <p>Assigns this Button's click handler</p> <p>Sets the height of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>Sets the background image (inline style) of the button. This method also changes the value of the <a href="#!/api/Ext.button.Button-cfg-icon" rel="Ext.button.Button-cfg-icon" class="docClass">icon</a> config internally.</p> <p>Sets the CSS class that provides a background image to use as the button's icon. This method also changes the value of the <a href="#!/api/Ext.button.Button-cfg-iconCls" rel="Ext.button.Button-cfg-iconCls" class="docClass">iconCls</a> config internally.</p> <p>This method allows you to show or hide a LoadMask on top of this component.</p> <p>Sets the overflow x/y on the content element of the component. The x/y overflow values can be any valid CSS overflow (e.g., 'auto' or 'scroll'). By default, the value is 'hidden'. Passing null for one of the values will erase the inline style. Passing <code>undefined</code> will preserve the current value.</p> <p>Sets the page XY position of the component. To set the left and top instead, use <a href="#!/api/Ext.Component-method-setPosition" rel="Ext.Component-method-setPosition" class="docClass">setPosition</a>. This method fires the <a href="#!/api/Ext.Component-event-move" rel="Ext.Component-event-move" class="docClass">move</a> event.</p> <p>Sets the href of the link dynamically according to the params passed, and any <a href="#!/api/Ext.button.Button-cfg-baseParams" rel="Ext.button.Button-cfg-baseParams" class="docClass">baseParams</a> configured.</p> <p><strong>Only valid if the Button was originally configured with a <a href="#!/api/Ext.button.Button-cfg-href" rel="Ext.button.Button-cfg-href" class="docClass">href</a></strong></p> <p>Sets the left and top of the component. To set the page XY position instead, use setPagePosition. This method fires the <a href="#!/api/Ext.AbstractComponent-event-move" rel="Ext.AbstractComponent-event-move" class="docClass">move</a> event.</p> <p>Method to change the scale of the button. See <a href="#!/api/Ext.button.Button-cfg-scale" rel="Ext.button.Button-cfg-scale" class="docClass">scale</a> for allowed configurations.</p> <p>Sets the width and height of this Component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event. This method can accept either width and height as separate arguments, or you can pass a size object like <code>{width:10, height:20}</code>.</p> <p>Sets this Button's text</p> <p>Sets the text alignment for this button.</p> <p>Sets the tooltip for this Button.</p> <p>Sets the UI for the component. This will remove any existing UIs on the component. It will also loop through any uiCls set on the component and rename them so they include the new UI</p> <p>Convenience function to hide or show this component by boolean.</p> <p>Sets the width of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>Shows this Component, rendering it first if <a href="#!/api/Ext.Component-cfg-autoRender" rel="Ext.Component-cfg-autoRender" class="docClass">autoRender</a> or <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> are <code>true</code>.</p> <p>After being shown, a <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Component (such as a <a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>), is activated it and brought to the front of its <a href="#!/api/Ext.Component-property-zIndexManager" rel="Ext.Component-property-zIndexManager" class="docClass">z-index stack</a>.</p> <p>Displays component at specific xy position. A floating component (like a menu) is positioned relative to its ownerCt if any. Useful for popping up a context menu:</p> <pre><code>listeners: { itemcontextmenu: function(view, record, item, index, event, options) { <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.menu.Menu" rel="Ext.menu.Menu" class="docClass">Ext.menu.Menu</a>', { width: 100, height: 100, margin: '0 0 10 0', items: [{ text: 'regular item 1' },{ text: 'regular item 2' },{ text: 'regular item 3' }] }).showAt(event.getXY()); } } </code></pre> <p>Shows this button's menu (if it has one)</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Ensures that all effects queued after syncFx is called on this object are run concurrently. This is the opposite of <a href="#!/api/Ext.util.Animate-method-sequenceFx" rel="Ext.util.Animate-method-sequenceFx" class="docClass">sequenceFx</a>.</p> <p>Sends this Component to the back of (lower z-index than) any other visible windows</p> <p>Brings this floating Component to the front of any other visible, floating Components managed by the same <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a></p> <p>If this Component is modal, inserts the modal mask just below this Component in the z-index stack.</p> <p>If a state it passed, it becomes the pressed state otherwise the current state is toggled.</p> <p>This is normally called internally on button click, but can be called externally to advance the button's active item programmatically to the next one in the menu. If the current item is the last one in the menu the active item will be set to the first item in the menu.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Walks up the <code>ownerCt</code> axis looking for an ancestor Container which matches the passed simple selector.</p> <p>Example:</p> <pre><code>var owningTabPanel = grid.up('tabpanel'); </code></pre> <p>Update the content area of a component.</p> <p>Sets the current box measurements of the component's underlying element.</p> <p>Updates this component's layout. If this update effects this components <a href="#!/api/Ext.AbstractComponent-property-ownerCt" rel="Ext.AbstractComponent-property-ownerCt" class="docClass">ownerCt</a>, that component's <code>updateLayout</code> method will be called to perform the layout instead. Otherwise, just this component (and its child items) will layout.</p> <p>Creates new Component.</p> <p>The configuration options may be specified as either:</p> <ul> <li><strong>an element</strong> : it is set as the internal element and its id used as the component id</li> <li><strong>a string</strong> : it is assumed to be the id of an existing element and is used as the component id</li> <li><strong>anything else</strong> : it is assumed to be a standard config object and is applied to the component</li> </ul> <p>Setting this property to <code>true</code> causes the <a href="#!/api/Ext.AbstractComponent-method-isLayoutRoot" rel="Ext.AbstractComponent-method-isLayoutRoot" class="docClass">isLayoutRoot</a> method to return <code>true</code> and stop the search for the top-most component for a layout.</p> <p>True if this button is disabled.</p> <p>Indicates whether or not the component can be dragged.</p> <p>Only present for <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which were inserted as descendant items of floating Containers.</p> <p>Floating Components that are programatically <a href="#!/api/Ext.Component-event-render" rel="Ext.Component-event-render" class="docClass">rendered</a> will not have a <code>floatParent</code> property.</p> <p>For <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which are child items of a Container, the floatParent will be the floating ancestor Container which is responsible for the base z-index value of all its floating descendants. It provides a <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a> which provides z-indexing services for all its descendant floating Components.</p> <p>For example, the dropdown <a href="#!/api/Ext.view.BoundList" rel="Ext.view.BoundList" class="docClass">BoundList</a> of a ComboBox which is in a Window will have the Window as its <code>floatParent</code></p> <p>See <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> and <a href="#!/api/Ext.Component-property-zIndexManager" rel="Ext.Component-property-zIndexManager" class="docClass">zIndexManager</a></p> <p>Indicates the width of any framing elements which were added within the encapsulating element to provide graphical, rounded borders. See the <a href="#!/api/Ext.AbstractComponent-cfg-frame" rel="Ext.AbstractComponent-cfg-frame" class="docClass">frame</a> config.</p> <p>This is an object containing the frame width in pixels for all four sides of the Component containing the following properties:</p> <p>True if this button is hidden.</p> <p>This is an internal flag that you use when creating custom components. By default this is set to true which means that every component gets a mask when its disabled. Components like FieldContainer, FieldSet, Field, Button, Tab override this property to false since they want to implement custom disable logic.</p> <p>The <a href="#!/api/Ext.menu.Menu" rel="Ext.menu.Menu" class="docClass">Menu</a> object associated with this Button when configured with the <a href="#!/api/Ext.button.Button-cfg-menu" rel="Ext.button.Button-cfg-menu" class="docClass">menu</a> config option.</p> <p>This Component's owner <a href="#!/api/Ext.container.Container" rel="Ext.container.Container" class="docClass">Container</a> (is set automatically when this Component is added to a Container).</p> <p><strong>Note</strong>: to access items within the Container see <a href="#!/api/Ext.AbstractComponent-cfg-itemId" rel="Ext.AbstractComponent-cfg-itemId" class="docClass">itemId</a>.</p> <p>True if this button is pressed (only if enableToggle = true).</p> <p>Indicates whether or not the component has been rendered.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>A <a href="#!/api/Ext.Template" rel="Ext.Template" class="docClass">Template</a> used to create the Button's DOM structure.</p> <p>Instances, or subclasses which need a different DOM structure may provide a different template layout in conjunction with an implementation of <a href="#!/api/Ext.button.Button-method-getTemplateArgs" rel="Ext.button.Button-method-getTemplateArgs" class="docClass">getTemplateArgs</a>.</p> <p>Only present for <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components after they have been rendered.</p> <p>A reference to the ZIndexManager which is managing this Component's z-index.</p> <p>The <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a> maintains a stack of floating Component z-indices, and also provides a single modal mask which is insert just beneath the topmost visible modal floating Component.</p> <p>Floating Components may be <a href="#!/api/Ext.Component-method-toFront" rel="Ext.Component-method-toFront" class="docClass">brought to the front</a> or <a href="#!/api/Ext.Component-method-toBack" rel="Ext.Component-method-toBack" class="docClass">sent to the back</a> of the z-index stack.</p> <p>This defaults to the global <a href="#!/api/Ext.WindowManager" rel="Ext.WindowManager" class="docClass">ZIndexManager</a> for floating Components that are programatically <a href="#!/api/Ext.Component-event-render" rel="Ext.Component-event-render" class="docClass">rendered</a>.</p> <p>For <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which are added to a Container, the ZIndexManager is acquired from the first ancestor Container found which is floating, or if not found the global <a href="#!/api/Ext.WindowManager" rel="Ext.WindowManager" class="docClass">ZIndexManager</a> is used.</p> <p>See <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> and <a href="#!/api/Ext.Component-property-floatParent" rel="Ext.Component-property-floatParent" class="docClass">floatParent</a></p> <p>Adds each argument passed to this method to the childEls array.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-addUIClsToElement" rel="Ext.AbstractComponent-method-addUIClsToElement" class="docClass">addUIClsToElement</a> and adds to all elements of this component.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Save a property to the given state object if it is not its default or configured value.</p> <p>Add events that will trigger the state to be saved. If the first argument is an array, each element of that array is the name of a state event. Otherwise, each argument passed to this method is the name of a state event.</p> <p>Method which adds a specified UI + uiCls to the components element. Can be overridden to remove the UI from more than just the components element.</p> <p>Called by the layout system when the Component has been layed out.</p> <p>Aligns this floating Component to the specified element</p> <p>Perform custom animation on this object.</p> <p>This method is applicable to both the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a> class and the <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a> class. It performs animated transitions of certain properties of this object over a specified timeline.</p> <p>The sole parameter is an object which specifies start property values, end property values, and properties which describe the timeline.</p> <h3>Animating an <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a></h3> <p>When animating an Element, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The page X position in pixels.</p></li> <li><p><code>y</code> - The page Y position in pixels</p></li> <li><p><code>left</code> - The element's CSS <code>left</code> value. Units must be supplied.</p></li> <li><p><code>top</code> - The element's CSS <code>top</code> value. Units must be supplied.</p></li> <li><p><code>width</code> - The element's CSS <code>width</code> value. Units must be supplied.</p></li> <li><p><code>height</code> - The element's CSS <code>height</code> value. Units must be supplied.</p></li> <li><p><code>scrollLeft</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>scrollTop</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>opacity</code> - The element's <code>opacity</code> value. This must be a value between <code>0</code> and <code>1</code>.</p></li> </ul> <p><strong>Be aware than animating an Element which is being used by an Ext Component without in some way informing the Component about the changed element state will result in incorrect Component behaviour. This is because the Component will be using the old state of the element. To avoid this problem, it is now possible to directly animate certain properties of Components.</strong></p> <h3>Animating a <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a></h3> <p>When animating a Component, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The Component's page X position in pixels.</p></li> <li><p><code>y</code> - The Component's page Y position in pixels</p></li> <li><p><code>left</code> - The Component's <code>left</code> value in pixels.</p></li> <li><p><code>top</code> - The Component's <code>top</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>dynamic</code> - Specify as true to update the Component's layout (if it is a Container) at every frame of the animation. <em>Use sparingly as laying out on every intermediate size change is an expensive operation.</em></p></li> </ul> <p>For example, to animate a Window to a new size, ensuring that its internal layout, and any shadow is correct:</p> <pre><code>myWindow = <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>', { title: 'Test Component animation', width: 500, height: 300, layout: { type: 'hbox', align: 'stretch' }, items: [{ title: 'Left: 33%', margins: '5 0 5 5', flex: 1 }, { title: 'Left: 66%', margins: '5 5 5 5', flex: 2 }] }); myWindow.show(); myWindow.header.el.on('click', function() { myWindow.animate({ to: { width: (myWindow.getWidth() == 500) ? 700 : 500, height: (myWindow.getHeight() == 300) ? 400 : 300, } }); }); </code></pre> <p>For performance reasons, by default, the internal layout is only updated when the Window reaches its final <code>"to"</code> size. If dynamic updating of the Window's child Components is required, then configure the animation with <code>dynamic: true</code> and the two child items will maintain their proportions during the animation.</p> <p>Applies the state to the object. This should be overridden in subclasses to do more complex state operations. By default it applies the state properties onto the current object.</p> <p>Utility wrapper that suspends layouts of all components for the duration of a given function.</p> <p>Occurs before componentLayout is run. Returning false from this method will prevent the componentLayout from being executed.</p> <p>Bubbles up the component/container heirarchy, calling the specified function with each component. The scope (<em>this</em>) of function call will be the scope provided or the current component. The arguments to the function will be the args provided or the current component. If the function returns false at any point, the bubble is stopped.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Center this Component in its container.</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Clone the current component using the original config values passed into this instance by default.</p> <p>Ensures that the plugins array contains fully constructed plugin instances. This converts any configs into their appropriate instances.</p> <p>Destroys the Component.</p> <p>Disable the component.</p> <p>Handles autoRender. Floating Components may have an ownerCt. If they are asking to be constrained, constrain them within that ownerCt, and have their z-index managed locally. Floating Components are always rendered to document.body</p> <p>This method needs to be called whenever you change something on this component that requires the Component's layout to be recalculated.</p> <p>Moves this floating Component into a constrain region.</p> <p>By default, this Component is constrained to be within the container it was added to, or the element it was rendered to.</p> <p>An alternative constraint may be passed.</p> <p>Enable the component</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Ensures that this component is attached to <code>document.body</code>. If the component was rendered to Ext.getDetachedBody, then it will be appended to <code>document.body</code>. Any configured position is also restored.</p> <p>Find a container above this component at any level by a custom function. If the passed function returns true, the container will be returned.</p> <p>Find a container above this component at any level by xtype or class</p> <p>See also the <a href="#!/api/Ext.Component-method-up" rel="Ext.Component-method-up" class="docClass">up</a> method.</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Try to focus this component.</p> <p>Forces this component to redo its componentLayout.</p> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Gets the current box measurements of the component's underlying element.</p> <p>Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy.</p> <p>Retrieves the top level element representing this component.</p> <p>Gets the current height of the component's underlying element.</p> <p>Retrieves the id of this component. Will autogenerate an id if one has not already been set.</p> <p>This function takes the position argument passed to onRender and returns a DOM element that you can use in the insertBefore.</p> <p>Gets the <a href="#!/api/Ext.ComponentLoader" rel="Ext.ComponentLoader" class="docClass">Ext.ComponentLoader</a> for this Component.</p> <p>Retrieves a plugin by its pluginId which has been bound to this component.</p> <p>Gets the current XY position of the component's underlying element.</p> <p>Gets the current size of the component's underlying element.</p> <p>Returns an object that describes how this component's width and height is managed. These objects are shared and should not be modified.</p> <p>The supplied default state gathering method for the AbstractComponent class.</p> <p>This method returns dimension settings such as <code>flex</code>, <code>anchor</code>, <code>width</code> and <code>height</code> along with <code>collapsed</code> state.</p> <p>Subclasses which implement more complex state should call the superclass's implementation, and apply their state to the result if this basic state is to be saved.</p> <p>Note that Component state will only be saved if the Component has a <a href="#!/api/Ext.AbstractComponent-cfg-stateId" rel="Ext.AbstractComponent-cfg-stateId" class="docClass">stateId</a> and there as a StateProvider configured for the document.</p> <p>Gets the state id for this object.</p> <p>This method returns an object which provides substitution parameters for the <a href="#!/api/Ext.button.Button-cfg-renderTpl" rel="Ext.button.Button-cfg-renderTpl" class="docClass">XTemplate</a> used to create this Button's DOM structure.</p> <p>Instances or subclasses which use a different Template to create a different DOM structure may need to provide their own implementation of this method.</p> <p>Gets the text for this Button</p> <p>Gets the current width of the component's underlying element.</p> <p>Gets the xtype for this component as registered with <a href="#!/api/Ext.ComponentManager" rel="Ext.ComponentManager" class="docClass">Ext.ComponentManager</a>. For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header. Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); alert(t.getXType()); // alerts 'textfield' </code></pre> <p>Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); alert(t.getXTypes()); // alerts 'component/field/textfield' </code></pre> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Checks if the specified CSS class exists on this element's DOM node.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Checks if there is currently a specified uiCls</p> <p>Returns true if the button has a menu and it is visible</p> <p>Hides this Component, setting it to invisible using the configured <a href="#!/api/Ext.Component-cfg-hideMode" rel="Ext.Component-cfg-hideMode" class="docClass">hideMode</a>.</p> <p>Hides this button's menu (if it has one)</p> <p>The initComponent template method is an important initialization step for a Component. It is intended to be implemented by each subclass of <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> to provide any needed constructor logic. The initComponent method of the class being created is called first, with each initComponent method up the hierarchy to <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> being called thereafter. This makes it easy to implement and, if needed, override the constructor logic of the Component at any step in the hierarchy.</p> <p>The initComponent method <strong>must</strong> contain a call to <a href="#!/api/Ext.Base-method-callParent" rel="Ext.Base-method-callParent" class="docClass">callParent</a> in order to ensure that the parent class' initComponent method is also called.</p> <p>All config options passed to the constructor are applied to <code>this</code> before initComponent is called, so you can simply access them with <code>this.someOption</code>.</p> <p>The following example demonstrates using a dynamic string for the text of a button at the time of instantiation of the class.</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('DynamicButtonText', { extend: '<a href="#!/api/Ext.button.Button" rel="Ext.button.Button" class="docClass">Ext.button.Button</a>', initComponent: function() { this.text = new Date(); this.renderTo = <a href="#!/api/Ext-method-getBody" rel="Ext-method-getBody" class="docClass">Ext.getBody</a>(); this.callParent(); } }); <a href="#!/api/Ext-method-onReady" rel="Ext-method-onReady" class="docClass">Ext.onReady</a>(function() { <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('DynamicButtonText'); }); </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Tests whether this Component matches the selector string.</p> <p>Determines whether this component is the descendant of a particular container.</p> <p>Method to determine whether this Component is currently disabled.</p> <p>Method to determine whether this Component is draggable.</p> <p>Method to determine whether this Component is droppable.</p> <p>Method to determine whether this Component is floating.</p> <p>Method to determine whether this Component is currently set to hidden.</p> <p>Determines whether this Component is the root of a layout. This returns <code>true</code> if this component can run its layout without assistance from or impact on its owner. If this component cannot run its layout given these restrictions, <code>false</code> is returned and its owner will be considered as the next candidate for the layout root.</p> <p>Setting the <a href="#!/api/Ext.AbstractComponent-property-_isLayoutRoot" rel="Ext.AbstractComponent-property-_isLayoutRoot" class="docClass">_isLayoutRoot</a> property to <code>true</code> causes this method to always return <code>true</code>. This may be useful when updating a layout of a Container which shrink wraps content, and you know that it will not change size, and so can safely be the topmost participant in the layout run.</p> <p>Returns true if layout is suspended for this component. This can come from direct suspension of this component's layout activity (suspendLayouts) or if one of this component's containers is suspended.</p> <p>Returns true if this component is visible.</p> <p>Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended from the xtype (default) or whether it is directly of the xtype specified (shallow = true).</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); var isText = t.isXType('textfield'); // true var isBoxSubclass = t.isXType('field'); // true, descended from <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> var isBoxInstance = t.isXType('field', true); // false, not a direct <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> instance </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Returns the next node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextSibling" rel="Ext.AbstractComponent-method-nextSibling" class="docClass">nextSibling</a>.</p> <p>Returns the next sibling of this Component.</p> <p>Optionally selects the next sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>next()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextNode" rel="Ext.AbstractComponent-method-nextNode" class="docClass">nextNode</a></p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Template method called when this Component's DOM structure is created.</p> <p>At this point, this Component's (And all descendants') DOM structure <i>exists</i> but it has not been layed out (positioned and sized).</p> <p>Subclasses which override this to gain access to the structure at render time should call the parent class's method before attempting to access any child elements of the Component.</p> <p>Returns the previous node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree in reverse order to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousSibling" rel="Ext.AbstractComponent-method-previousSibling" class="docClass">previousSibling</a>.</p> <p>Returns the previous sibling of this Component.</p> <p>Optionally selects the previous sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>prev()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousNode" rel="Ext.AbstractComponent-method-previousNode" class="docClass">previousNode</a></p> <p>Called by Component#doAutoRender</p> <p>Register a Container configured <code>floating: true</code> with this Component's <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a>.</p> <p>Components added in ths way will not participate in any layout, but will be rendered upon first show in the way that <a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Window</a>s are.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes items in the childEls array based on the return value of a supplied test function. The function is called with a entry in childEls and if the test function return true, that entry is removed. If false, that entry is kept.</p> <p>Removes a CSS class from the top level element representing this component.</p> <p>Removes a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-removeUIClsFromElement" rel="Ext.AbstractComponent-method-removeUIClsFromElement" class="docClass">removeUIClsFromElement</a> and removes it from all elements of this component.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Method which removes a specified UI + uiCls from the components element. The cls which is added to the element will be: <code>this.baseCls + '-' + ui</code></p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Conditionally saves a single property from this object to the given state object. The idea is to only save state which has changed from the initial state so that current software settings do not override future software settings. Only those values that are user-changed state should be saved.</p> <p>Scrolls this Component's target element by the passed delta values, optionally animating.</p> <p>All of the following are equivalent:</p> <pre><code> comp.scrollBy(10, 10, true); comp.scrollBy([10, 10], true); comp.scrollBy({ x: 10, y: 10 }, true); </code></pre> <p>Ensures that all effects queued after sequenceFx is called on this object are run in sequence. This is the opposite of <a href="#!/api/Ext.util.Animate-method-syncFx" rel="Ext.util.Animate-method-syncFx" class="docClass">syncFx</a>.</p> <p>This method is called internally by <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">Ext.ZIndexManager</a> to signal that a floating Component has either been moved to the top of its zIndex stack, or pushed from the top of its zIndex stack.</p> <p>If a <em>Window</em> is superceded by another Window, deactivating it hides its shadow.</p> <p>This method also fires the <a href="#!/api/Ext.Component-event-activate" rel="Ext.Component-event-activate" class="docClass">activate</a> or <a href="#!/api/Ext.Component-event-deactivate" rel="Ext.Component-event-deactivate" class="docClass">deactivate</a> event depending on which action occurred.</p> <p>Sets this button's arrow click handler.</p> <p>Sets the overflow on the content element of the component.</p> <p>Enable or disable the component.</p> <p>Sets the dock position of this component in its parent panel. Note that this only has effect if this item is part of the dockedItems collection of a parent that has a DockLayout (note that any Panel has a DockLayout by default)</p> <p>Assigns this Button's click handler</p> <p>Sets the height of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>Sets the background image (inline style) of the button. This method also changes the value of the <a href="#!/api/Ext.button.Button-cfg-icon" rel="Ext.button.Button-cfg-icon" class="docClass">icon</a> config internally.</p> <p>Sets the CSS class that provides a background image to use as the button's icon. This method also changes the value of the <a href="#!/api/Ext.button.Button-cfg-iconCls" rel="Ext.button.Button-cfg-iconCls" class="docClass">iconCls</a> config internally.</p> <p>This method allows you to show or hide a LoadMask on top of this component.</p> <p>Sets the overflow x/y on the content element of the component. The x/y overflow values can be any valid CSS overflow (e.g., 'auto' or 'scroll'). By default, the value is 'hidden'. Passing null for one of the values will erase the inline style. Passing <code>undefined</code> will preserve the current value.</p> <p>Sets the page XY position of the component. To set the left and top instead, use <a href="#!/api/Ext.Component-method-setPosition" rel="Ext.Component-method-setPosition" class="docClass">setPosition</a>. This method fires the <a href="#!/api/Ext.Component-event-move" rel="Ext.Component-event-move" class="docClass">move</a> event.</p> <p>Sets the href of the link dynamically according to the params passed, and any <a href="#!/api/Ext.button.Button-cfg-baseParams" rel="Ext.button.Button-cfg-baseParams" class="docClass">baseParams</a> configured.</p> <p><strong>Only valid if the Button was originally configured with a <a href="#!/api/Ext.button.Button-cfg-href" rel="Ext.button.Button-cfg-href" class="docClass">href</a></strong></p> <p>Sets the left and top of the component. To set the page XY position instead, use setPagePosition. This method fires the <a href="#!/api/Ext.AbstractComponent-event-move" rel="Ext.AbstractComponent-event-move" class="docClass">move</a> event.</p> <p>Method to change the scale of the button. See <a href="#!/api/Ext.button.Button-cfg-scale" rel="Ext.button.Button-cfg-scale" class="docClass">scale</a> for allowed configurations.</p> <p>Sets the width and height of this Component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event. This method can accept either width and height as separate arguments, or you can pass a size object like <code>{width:10, height:20}</code>.</p> <p>Sets this Button's text</p> <p>Sets the text alignment for this button.</p> <p>Sets the tooltip for this Button.</p> <p>Sets the UI for the component. This will remove any existing UIs on the component. It will also loop through any uiCls set on the component and rename them so they include the new UI</p> <p>Convenience function to hide or show this component by boolean.</p> <p>Sets the width of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>Shows this Component, rendering it first if <a href="#!/api/Ext.Component-cfg-autoRender" rel="Ext.Component-cfg-autoRender" class="docClass">autoRender</a> or <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> are <code>true</code>.</p> <p>After being shown, a <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Component (such as a <a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>), is activated it and brought to the front of its <a href="#!/api/Ext.Component-property-zIndexManager" rel="Ext.Component-property-zIndexManager" class="docClass">z-index stack</a>.</p> <p>Displays component at specific xy position. A floating component (like a menu) is positioned relative to its ownerCt if any. Useful for popping up a context menu:</p> <pre><code>listeners: { itemcontextmenu: function(view, record, item, index, event, options) { <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.menu.Menu" rel="Ext.menu.Menu" class="docClass">Ext.menu.Menu</a>', { width: 100, height: 100, margin: '0 0 10 0', items: [{ text: 'regular item 1' },{ text: 'regular item 2' },{ text: 'regular item 3' }] }).showAt(event.getXY()); } } </code></pre> <p>Shows this button's menu (if it has one)</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Ensures that all effects queued after syncFx is called on this object are run concurrently. This is the opposite of <a href="#!/api/Ext.util.Animate-method-sequenceFx" rel="Ext.util.Animate-method-sequenceFx" class="docClass">sequenceFx</a>.</p> <p>Sends this Component to the back of (lower z-index than) any other visible windows</p> <p>Brings this floating Component to the front of any other visible, floating Components managed by the same <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a></p> <p>If this Component is modal, inserts the modal mask just below this Component in the z-index stack.</p> <p>If a state it passed, it becomes the pressed state otherwise the current state is toggled.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Walks up the <code>ownerCt</code> axis looking for an ancestor Container which matches the passed simple selector.</p> <p>Example:</p> <pre><code>var owningTabPanel = grid.up('tabpanel'); </code></pre> <p>Update the content area of a component.</p> <p>Sets the current box measurements of the component's underlying element.</p> <p>Updates this component's layout. If this update effects this components <a href="#!/api/Ext.AbstractComponent-property-ownerCt" rel="Ext.AbstractComponent-property-ownerCt" class="docClass">ownerCt</a>, that component's <code>updateLayout</code> method will be called to perform the layout instead. Otherwise, just this component (and its child items) will layout.</p> <p>Creates new Axis.</p> <p>Config options.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Creates new Axis.</p> <p>Config options.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Renders the axis into the screen and updates its position.</p> <p>Renders an horizontal and/or vertical grid into the Surface.</p> <p>Renders the labels in the axes.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Updates the <a href="#!/api/Ext.chart.axis.Axis-cfg-title" rel="Ext.chart.axis.Axis-cfg-title" class="docClass">title</a> of this axis.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Creates new Axis.</p> <p>Config options.</p> <p>Indicates whether or not to calculate the number of categories (ticks and labels) when there is not enough room to display all labels on the axis. If set to true, the axis will determine the number of categories to plot. If not, all categories will be plotted.</p> <p>A list of category names to display along this axis.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Renders the axis into the screen and updates its position.</p> <p>Renders an horizontal and/or vertical grid into the Surface.</p> <p>Renders the labels in the axes.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Updates the <a href="#!/api/Ext.chart.axis.Axis-cfg-title" rel="Ext.chart.axis.Axis-cfg-title" class="docClass">title</a> of this axis.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Creates new Axis.</p> <p>Config options.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Updates the <a href="#!/api/Ext.chart.axis.Gauge-cfg-title" rel="Ext.chart.axis.Gauge-cfg-title" class="docClass">title</a> of this axis.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Creates new Axis.</p> <p>Config options.</p> <p>Indicates whether to extend maximum beyond data's maximum to the nearest majorUnit.</p> <p>Indicates whether to extend the minimum beyond data's minimum to the nearest majorUnit.</p> <p>The number of decimals to round the value to.</p> <p>The maximum value drawn by the axis. If not set explicitly, the axis maximum will be calculated automatically.</p> <p>The minimum value drawn by the axis. If not set explicitly, the axis minimum will be calculated automatically.</p> <p>Indicates the position of the axis relative to the chart</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Renders the axis into the screen and updates its position.</p> <p>Renders an horizontal and/or vertical grid into the Surface.</p> <p>Renders the labels in the axes.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Updates the <a href="#!/api/Ext.chart.axis.Axis-cfg-title" rel="Ext.chart.axis.Axis-cfg-title" class="docClass">title</a> of this axis.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Creates new Axis.</p> <p>Config options.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Creates new Axis.</p> <p>Config options.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Renders the axis into the screen and updates its position.</p> <p>Renders an horizontal and/or vertical grid into the Surface.</p> <p>Renders the labels in the axes.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Updates the <a href="#!/api/Ext.chart.axis.Axis-cfg-title" rel="Ext.chart.axis.Axis-cfg-title" class="docClass">title</a> of this axis.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Creates new Mask.</p> <p>Config object.</p> <p>Setting this property to <code>true</code> causes the <a href="#!/api/Ext.AbstractComponent-method-isLayoutRoot" rel="Ext.AbstractComponent-method-isLayoutRoot" class="docClass">isLayoutRoot</a> method to return <code>true</code> and stop the search for the top-most component for a layout.</p> <p>Indicates whether or not the component can be dragged.</p> <p>Only present for <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which were inserted as descendant items of floating Containers.</p> <p>Floating Components that are programatically <a href="#!/api/Ext.Component-event-render" rel="Ext.Component-event-render" class="docClass">rendered</a> will not have a <code>floatParent</code> property.</p> <p>For <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which are child items of a Container, the floatParent will be the floating ancestor Container which is responsible for the base z-index value of all its floating descendants. It provides a <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a> which provides z-indexing services for all its descendant floating Components.</p> <p>For example, the dropdown <a href="#!/api/Ext.view.BoundList" rel="Ext.view.BoundList" class="docClass">BoundList</a> of a ComboBox which is in a Window will have the Window as its <code>floatParent</code></p> <p>See <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> and <a href="#!/api/Ext.Component-property-zIndexManager" rel="Ext.Component-property-zIndexManager" class="docClass">zIndexManager</a></p> <p>Indicates the width of any framing elements which were added within the encapsulating element to provide graphical, rounded borders. See the <a href="#!/api/Ext.AbstractComponent-cfg-frame" rel="Ext.AbstractComponent-cfg-frame" class="docClass">frame</a> config.</p> <p>This is an object containing the frame width in pixels for all four sides of the Component containing the following properties:</p> <p>This is an internal flag that you use when creating custom components. By default this is set to true which means that every component gets a mask when its disabled. Components like FieldContainer, FieldSet, Field, Button, Tab override this property to false since they want to implement custom disable logic.</p> <p>This Component's owner <a href="#!/api/Ext.container.Container" rel="Ext.container.Container" class="docClass">Container</a> (is set automatically when this Component is added to a Container).</p> <p><strong>Note</strong>: to access items within the Container see <a href="#!/api/Ext.AbstractComponent-cfg-itemId" rel="Ext.AbstractComponent-cfg-itemId" class="docClass">itemId</a>.</p> <p>Indicates whether or not the component has been rendered.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Only present for <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components after they have been rendered.</p> <p>A reference to the ZIndexManager which is managing this Component's z-index.</p> <p>The <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a> maintains a stack of floating Component z-indices, and also provides a single modal mask which is insert just beneath the topmost visible modal floating Component.</p> <p>Floating Components may be <a href="#!/api/Ext.Component-method-toFront" rel="Ext.Component-method-toFront" class="docClass">brought to the front</a> or <a href="#!/api/Ext.Component-method-toBack" rel="Ext.Component-method-toBack" class="docClass">sent to the back</a> of the z-index stack.</p> <p>This defaults to the global <a href="#!/api/Ext.WindowManager" rel="Ext.WindowManager" class="docClass">ZIndexManager</a> for floating Components that are programatically <a href="#!/api/Ext.Component-event-render" rel="Ext.Component-event-render" class="docClass">rendered</a>.</p> <p>For <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which are added to a Container, the ZIndexManager is acquired from the first ancestor Container found which is floating, or if not found the global <a href="#!/api/Ext.WindowManager" rel="Ext.WindowManager" class="docClass">ZIndexManager</a> is used.</p> <p>See <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> and <a href="#!/api/Ext.Component-property-floatParent" rel="Ext.Component-property-floatParent" class="docClass">floatParent</a></p> <p>Adds each argument passed to this method to the childEls array.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-addUIClsToElement" rel="Ext.AbstractComponent-method-addUIClsToElement" class="docClass">addUIClsToElement</a> and adds to all elements of this component.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Save a property to the given state object if it is not its default or configured value.</p> <p>Add events that will trigger the state to be saved. If the first argument is an array, each element of that array is the name of a state event. Otherwise, each argument passed to this method is the name of a state event.</p> <p>Method which adds a specified UI + uiCls to the components element. Can be overridden to remove the UI from more than just the components element.</p> <p>Called by the layout system when the Component has been layed out.</p> <p>Aligns this floating Component to the specified element</p> <p>Perform custom animation on this object.</p> <p>This method is applicable to both the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a> class and the <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a> class. It performs animated transitions of certain properties of this object over a specified timeline.</p> <p>The sole parameter is an object which specifies start property values, end property values, and properties which describe the timeline.</p> <h3>Animating an <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a></h3> <p>When animating an Element, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The page X position in pixels.</p></li> <li><p><code>y</code> - The page Y position in pixels</p></li> <li><p><code>left</code> - The element's CSS <code>left</code> value. Units must be supplied.</p></li> <li><p><code>top</code> - The element's CSS <code>top</code> value. Units must be supplied.</p></li> <li><p><code>width</code> - The element's CSS <code>width</code> value. Units must be supplied.</p></li> <li><p><code>height</code> - The element's CSS <code>height</code> value. Units must be supplied.</p></li> <li><p><code>scrollLeft</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>scrollTop</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>opacity</code> - The element's <code>opacity</code> value. This must be a value between <code>0</code> and <code>1</code>.</p></li> </ul> <p><strong>Be aware than animating an Element which is being used by an Ext Component without in some way informing the Component about the changed element state will result in incorrect Component behaviour. This is because the Component will be using the old state of the element. To avoid this problem, it is now possible to directly animate certain properties of Components.</strong></p> <h3>Animating a <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a></h3> <p>When animating a Component, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The Component's page X position in pixels.</p></li> <li><p><code>y</code> - The Component's page Y position in pixels</p></li> <li><p><code>left</code> - The Component's <code>left</code> value in pixels.</p></li> <li><p><code>top</code> - The Component's <code>top</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>dynamic</code> - Specify as true to update the Component's layout (if it is a Container) at every frame of the animation. <em>Use sparingly as laying out on every intermediate size change is an expensive operation.</em></p></li> </ul> <p>For example, to animate a Window to a new size, ensuring that its internal layout, and any shadow is correct:</p> <pre><code>myWindow = <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>', { title: 'Test Component animation', width: 500, height: 300, layout: { type: 'hbox', align: 'stretch' }, items: [{ title: 'Left: 33%', margins: '5 0 5 5', flex: 1 }, { title: 'Left: 66%', margins: '5 5 5 5', flex: 2 }] }); myWindow.show(); myWindow.header.el.on('click', function() { myWindow.animate({ to: { width: (myWindow.getWidth() == 500) ? 700 : 500, height: (myWindow.getHeight() == 300) ? 400 : 300, } }); }); </code></pre> <p>For performance reasons, by default, the internal layout is only updated when the Window reaches its final <code>"to"</code> size. If dynamic updating of the Window's child Components is required, then configure the animation with <code>dynamic: true</code> and the two child items will maintain their proportions during the animation.</p> <p>Applies the state to the object. This should be overridden in subclasses to do more complex state operations. By default it applies the state properties onto the current object.</p> <p>Utility wrapper that suspends layouts of all components for the duration of a given function.</p> <p>Occurs before componentLayout is run. Returning false from this method will prevent the componentLayout from being executed.</p> <p>Binds a store to this instance.</p> <p>Binds listeners for this component to the store. By default it will add anything bound by the getStoreListeners method, however it can be overridden in a subclass to provide any more complicated handling.</p> <p>Bubbles up the component/container heirarchy, calling the specified function with each component. The scope (<em>this</em>) of function call will be the scope provided or the current component. The arguments to the function will be the args provided or the current component. If the function returns false at any point, the bubble is stopped.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Center this Component in its container.</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Clone the current component using the original config values passed into this instance by default.</p> <p>Ensures that the plugins array contains fully constructed plugin instances. This converts any configs into their appropriate instances.</p> <p>Create the Surface instance. Resolves the correct Surface implementation to instantiate based on the 'enginePriority' config. Once the Surface instance is created you can use the handle to that instance to add sprites. For example:</p> <pre><code>drawComponent.surface.add(sprite); </code></pre> <p>Destroys the Component.</p> <p>Disable the component.</p> <p>Handles autoRender. Floating Components may have an ownerCt. If they are asking to be constrained, constrain them within that ownerCt, and have their z-index managed locally. Floating Components are always rendered to document.body</p> <p>This method needs to be called whenever you change something on this component that requires the Component's layout to be recalculated.</p> <p>Moves this floating Component into a constrain region.</p> <p>By default, this Component is constrained to be within the container it was added to, or the element it was rendered to.</p> <p>An alternative constraint may be passed.</p> <p>Enable the component</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Ensures that this component is attached to <code>document.body</code>. If the component was rendered to Ext.getDetachedBody, then it will be appended to <code>document.body</code>. Any configured position is also restored.</p> <p>Find a container above this component at any level by a custom function. If the passed function returns true, the container will be returned.</p> <p>Find a container above this component at any level by xtype or class</p> <p>See also the <a href="#!/api/Ext.Component-method-up" rel="Ext.Component-method-up" class="docClass">up</a> method.</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Try to focus this component.</p> <p>Forces this component to redo its componentLayout.</p> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Gets the current box measurements of the component's underlying element.</p> <p>Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy.</p> <p>Retrieves the top level element representing this component.</p> <p>Gets the current height of the component's underlying element.</p> <p>Retrieves the id of this component. Will autogenerate an id if one has not already been set.</p> <p>This function takes the position argument passed to onRender and returns a DOM element that you can use in the insertBefore.</p> <p>Gets the <a href="#!/api/Ext.ComponentLoader" rel="Ext.ComponentLoader" class="docClass">Ext.ComponentLoader</a> for this Component.</p> <p>Retrieves a plugin by its pluginId which has been bound to this component.</p> <p>Gets the current XY position of the component's underlying element.</p> <p>Gets the current size of the component's underlying element.</p> <p>Returns an object that describes how this component's width and height is managed. These objects are shared and should not be modified.</p> <p>The supplied default state gathering method for the AbstractComponent class.</p> <p>This method returns dimension settings such as <code>flex</code>, <code>anchor</code>, <code>width</code> and <code>height</code> along with <code>collapsed</code> state.</p> <p>Subclasses which implement more complex state should call the superclass's implementation, and apply their state to the result if this basic state is to be saved.</p> <p>Note that Component state will only be saved if the Component has a <a href="#!/api/Ext.AbstractComponent-cfg-stateId" rel="Ext.AbstractComponent-cfg-stateId" class="docClass">stateId</a> and there as a StateProvider configured for the document.</p> <p>Gets the state id for this object.</p> <p>Gets the current store instance.</p> <p>Gets the listeners to bind to a new store.</p> <p>Gets the current width of the component's underlying element.</p> <p>Gets the xtype for this component as registered with <a href="#!/api/Ext.ComponentManager" rel="Ext.ComponentManager" class="docClass">Ext.ComponentManager</a>. For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header. Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); alert(t.getXType()); // alerts 'textfield' </code></pre> <p>Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); alert(t.getXTypes()); // alerts 'component/field/textfield' </code></pre> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Checks if the specified CSS class exists on this element's DOM node.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Checks if there is currently a specified uiCls</p> <p>Hides this Component, setting it to invisible using the configured <a href="#!/api/Ext.Component-cfg-hideMode" rel="Ext.Component-cfg-hideMode" class="docClass">hideMode</a>.</p> <p>The initComponent template method is an important initialization step for a Component. It is intended to be implemented by each subclass of <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> to provide any needed constructor logic. The initComponent method of the class being created is called first, with each initComponent method up the hierarchy to <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> being called thereafter. This makes it easy to implement and, if needed, override the constructor logic of the Component at any step in the hierarchy.</p> <p>The initComponent method <strong>must</strong> contain a call to <a href="#!/api/Ext.Base-method-callParent" rel="Ext.Base-method-callParent" class="docClass">callParent</a> in order to ensure that the parent class' initComponent method is also called.</p> <p>All config options passed to the constructor are applied to <code>this</code> before initComponent is called, so you can simply access them with <code>this.someOption</code>.</p> <p>The following example demonstrates using a dynamic string for the text of a button at the time of instantiation of the class.</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('DynamicButtonText', { extend: '<a href="#!/api/Ext.button.Button" rel="Ext.button.Button" class="docClass">Ext.button.Button</a>', initComponent: function() { this.text = new Date(); this.renderTo = <a href="#!/api/Ext-method-getBody" rel="Ext-method-getBody" class="docClass">Ext.getBody</a>(); this.callParent(); } }); <a href="#!/api/Ext-method-onReady" rel="Ext-method-onReady" class="docClass">Ext.onReady</a>(function() { <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('DynamicButtonText'); }); </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Tests whether this Component matches the selector string.</p> <p>Determines whether this component is the descendant of a particular container.</p> <p>Method to determine whether this Component is currently disabled.</p> <p>Method to determine whether this Component is draggable.</p> <p>Method to determine whether this Component is droppable.</p> <p>Method to determine whether this Component is floating.</p> <p>Method to determine whether this Component is currently set to hidden.</p> <p>Determines whether this Component is the root of a layout. This returns <code>true</code> if this component can run its layout without assistance from or impact on its owner. If this component cannot run its layout given these restrictions, <code>false</code> is returned and its owner will be considered as the next candidate for the layout root.</p> <p>Setting the <a href="#!/api/Ext.AbstractComponent-property-_isLayoutRoot" rel="Ext.AbstractComponent-property-_isLayoutRoot" class="docClass">_isLayoutRoot</a> property to <code>true</code> causes this method to always return <code>true</code>. This may be useful when updating a layout of a Container which shrink wraps content, and you know that it will not change size, and so can safely be the topmost participant in the layout run.</p> <p>Returns true if layout is suspended for this component. This can come from direct suspension of this component's layout activity (suspendLayouts) or if one of this component's containers is suspended.</p> <p>Returns true if this component is visible.</p> <p>Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended from the xtype (default) or whether it is directly of the xtype specified (shallow = true).</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); var isText = t.isXType('textfield'); // true var isBoxSubclass = t.isXType('field'); // true, descended from <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> var isBoxInstance = t.isXType('field', true); // false, not a direct <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> instance </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Returns the next node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextSibling" rel="Ext.AbstractComponent-method-nextSibling" class="docClass">nextSibling</a>.</p> <p>Returns the next sibling of this Component.</p> <p>Optionally selects the next sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>next()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextNode" rel="Ext.AbstractComponent-method-nextNode" class="docClass">nextNode</a></p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Template method, it is called when a new store is bound to the current instance.</p> <p>Template method, it is called when an existing store is unbound from the current instance.</p> <p>Returns the previous node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree in reverse order to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousSibling" rel="Ext.AbstractComponent-method-previousSibling" class="docClass">previousSibling</a>.</p> <p>Returns the previous sibling of this Component.</p> <p>Optionally selects the previous sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>prev()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousNode" rel="Ext.AbstractComponent-method-previousNode" class="docClass">previousNode</a></p> <p>Redraws the chart. If animations are set this will animate the chart too.</p> <p>Called by Component#doAutoRender</p> <p>Register a Container configured <code>floating: true</code> with this Component's <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a>.</p> <p>Components added in ths way will not participate in any layout, but will be rendered upon first show in the way that <a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Window</a>s are.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes items in the childEls array based on the return value of a supplied test function. The function is called with a entry in childEls and if the test function return true, that entry is removed. If false, that entry is kept.</p> <p>Removes a CSS class from the top level element representing this component.</p> <p>Removes a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-removeUIClsFromElement" rel="Ext.AbstractComponent-method-removeUIClsFromElement" class="docClass">removeUIClsFromElement</a> and removes it from all elements of this component.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Method which removes a specified UI + uiCls from the components element. The cls which is added to the element will be: <code>this.baseCls + '-' + ui</code></p> <p>Restores the zoom to the original value. This can be used to reset the previous zoom state set by <code>setZoom</code>. For example:</p> <pre><code>myChart.restoreZoom(); </code></pre> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Saves the chart by either triggering a download or returning a string containing the chart data. The action depends on the export type specified in the passed configuration.</p> <p>Possible export types: - "image/png" - "image/svg+xml"</p> <p>Other configuration properties: - width</p> <p>Example usage:</p> <p>chart.save({</p> <pre><code> type: 'image/png' </code></pre> <p>});</p> <p>Conditionally saves a single property from this object to the given state object. The idea is to only save state which has changed from the initial state so that current software settings do not override future software settings. Only those values that are user-changed state should be saved.</p> <p>Scrolls this Component's target element by the passed delta values, optionally animating.</p> <p>All of the following are equivalent:</p> <pre><code> comp.scrollBy(10, 10, true); comp.scrollBy([10, 10], true); comp.scrollBy({ x: 10, y: 10 }, true); </code></pre> <p>Ensures that all effects queued after sequenceFx is called on this object are run in sequence. This is the opposite of <a href="#!/api/Ext.util.Animate-method-syncFx" rel="Ext.util.Animate-method-syncFx" class="docClass">syncFx</a>.</p> <p>This method is called internally by <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">Ext.ZIndexManager</a> to signal that a floating Component has either been moved to the top of its zIndex stack, or pushed from the top of its zIndex stack.</p> <p>If a <em>Window</em> is superceded by another Window, deactivating it hides its shadow.</p> <p>This method also fires the <a href="#!/api/Ext.Component-event-activate" rel="Ext.Component-event-activate" class="docClass">activate</a> or <a href="#!/api/Ext.Component-event-deactivate" rel="Ext.Component-event-deactivate" class="docClass">deactivate</a> event depending on which action occurred.</p> <p>Sets the overflow on the content element of the component.</p> <p>Enable or disable the component.</p> <p>Sets the dock position of this component in its parent panel. Note that this only has effect if this item is part of the dockedItems collection of a parent that has a DockLayout (note that any Panel has a DockLayout by default)</p> <p>Sets the height of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>This method allows you to show or hide a LoadMask on top of this component.</p> <p>Sets the overflow x/y on the content element of the component. The x/y overflow values can be any valid CSS overflow (e.g., 'auto' or 'scroll'). By default, the value is 'hidden'. Passing null for one of the values will erase the inline style. Passing <code>undefined</code> will preserve the current value.</p> <p>Sets the page XY position of the component. To set the left and top instead, use <a href="#!/api/Ext.Component-method-setPosition" rel="Ext.Component-method-setPosition" class="docClass">setPosition</a>. This method fires the <a href="#!/api/Ext.Component-event-move" rel="Ext.Component-event-move" class="docClass">move</a> event.</p> <p>Sets the left and top of the component. To set the page XY position instead, use setPagePosition. This method fires the <a href="#!/api/Ext.AbstractComponent-event-move" rel="Ext.AbstractComponent-event-move" class="docClass">move</a> event.</p> <p>Sets the width and height of this Component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event. This method can accept either width and height as separate arguments, or you can pass a size object like <code>{width:10, height:20}</code>.</p> <p>Sets the UI for the component. This will remove any existing UIs on the component. It will also loop through any uiCls set on the component and rename them so they include the new UI</p> <p>Convenience function to hide or show this component by boolean.</p> <p>Sets the width of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>Zooms the chart to the specified selection range. Can be used with a selection mask. For example:</p> <pre><code>items: { xtype: 'chart', animate: true, store: store1, mask: 'horizontal', listeners: { select: { fn: function(me, selection) { me.setZoom(selection); me.mask.hide(); } } } } </code></pre> <p>Shows this Component, rendering it first if <a href="#!/api/Ext.Component-cfg-autoRender" rel="Ext.Component-cfg-autoRender" class="docClass">autoRender</a> or <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> are <code>true</code>.</p> <p>After being shown, a <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Component (such as a <a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>), is activated it and brought to the front of its <a href="#!/api/Ext.Component-property-zIndexManager" rel="Ext.Component-property-zIndexManager" class="docClass">z-index stack</a>.</p> <p>Displays component at specific xy position. A floating component (like a menu) is positioned relative to its ownerCt if any. Useful for popping up a context menu:</p> <pre><code>listeners: { itemcontextmenu: function(view, record, item, index, event, options) { <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.menu.Menu" rel="Ext.menu.Menu" class="docClass">Ext.menu.Menu</a>', { width: 100, height: 100, margin: '0 0 10 0', items: [{ text: 'regular item 1' },{ text: 'regular item 2' },{ text: 'regular item 3' }] }).showAt(event.getXY()); } } </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Ensures that all effects queued after syncFx is called on this object are run concurrently. This is the opposite of <a href="#!/api/Ext.util.Animate-method-sequenceFx" rel="Ext.util.Animate-method-sequenceFx" class="docClass">sequenceFx</a>.</p> <p>Sends this Component to the back of (lower z-index than) any other visible windows</p> <p>Brings this floating Component to the front of any other visible, floating Components managed by the same <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a></p> <p>If this Component is modal, inserts the modal mask just below this Component in the z-index stack.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Unbinds listeners from this component to the store. By default it will remove anything bound by the bindStoreListeners method, however it can be overridden in a subclass to provide any more complicated handling.</p> <p>Walks up the <code>ownerCt</code> axis looking for an ancestor Container which matches the passed simple selector.</p> <p>Example:</p> <pre><code>var owningTabPanel = grid.up('tabpanel'); </code></pre> <p>Update the content area of a component.</p> <p>Sets the current box measurements of the component's underlying element.</p> <p>Updates this component's layout. If this update effects this components <a href="#!/api/Ext.AbstractComponent-property-ownerCt" rel="Ext.AbstractComponent-property-ownerCt" class="docClass">ownerCt</a>, that component's <code>updateLayout</code> method will be called to perform the layout instead. Otherwise, just this component (and its child items) will layout.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Highlight the given series item.</p> <p>Highlight the given series item.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Un-highlight any existing highlights</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Creates new Legend.</p> <p>Config object.</p> <p>Whether the legend box is oriented vertically, i.e. if it is on the left or right side or floating.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Creates new MixedCollection.</p> <p>Specify <tt>true</tt> if the <a href="#!/api/Ext.util.MixedCollection-method-addAll" rel="Ext.util.MixedCollection-method-addAll" class="docClass">addAll</a> function should add function references to the collection. Defaults to <tt>false</tt>.</p> <p>A function that can accept an item of the type(s) stored in this MixedCollection and return the key value for that item. This is used when available to look up the key on items that were passed without an explicit key parameter to a MixedCollection method. Passing this parameter is equivalent to providing an implementation for the <a href="#!/api/Ext.util.MixedCollection-method-getKey" rel="Ext.util.MixedCollection-method-getKey" class="docClass">getKey</a> method.</p> <p>The default sort direction to use if one is not specified.</p> <p>Flag denoting that this object is sortable. Always true.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>The property in each item that contains the data to sort.</p> <p>The collection of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Sorters</a> currently applied to this Store</p> <p>Adds an item to the collection. Fires the <a href="#!/api/Ext.util.AbstractMixedCollection-event-add" rel="Ext.util.AbstractMixedCollection-event-add" class="docClass">add</a> event when complete.</p> <p>Adds all elements of an Array or an Object to the collection.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Perform custom animation on this object.</p> <p>This method is applicable to both the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a> class and the <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a> class. It performs animated transitions of certain properties of this object over a specified timeline.</p> <p>The sole parameter is an object which specifies start property values, end property values, and properties which describe the timeline.</p> <h3>Animating an <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a></h3> <p>When animating an Element, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The page X position in pixels.</p></li> <li><p><code>y</code> - The page Y position in pixels</p></li> <li><p><code>left</code> - The element's CSS <code>left</code> value. Units must be supplied.</p></li> <li><p><code>top</code> - The element's CSS <code>top</code> value. Units must be supplied.</p></li> <li><p><code>width</code> - The element's CSS <code>width</code> value. Units must be supplied.</p></li> <li><p><code>height</code> - The element's CSS <code>height</code> value. Units must be supplied.</p></li> <li><p><code>scrollLeft</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>scrollTop</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>opacity</code> - The element's <code>opacity</code> value. This must be a value between <code>0</code> and <code>1</code>.</p></li> </ul> <p><strong>Be aware than animating an Element which is being used by an Ext Component without in some way informing the Component about the changed element state will result in incorrect Component behaviour. This is because the Component will be using the old state of the element. To avoid this problem, it is now possible to directly animate certain properties of Components.</strong></p> <h3>Animating a <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a></h3> <p>When animating a Component, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The Component's page X position in pixels.</p></li> <li><p><code>y</code> - The Component's page Y position in pixels</p></li> <li><p><code>left</code> - The Component's <code>left</code> value in pixels.</p></li> <li><p><code>top</code> - The Component's <code>top</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>dynamic</code> - Specify as true to update the Component's layout (if it is a Container) at every frame of the animation. <em>Use sparingly as laying out on every intermediate size change is an expensive operation.</em></p></li> </ul> <p>For example, to animate a Window to a new size, ensuring that its internal layout, and any shadow is correct:</p> <pre><code>myWindow = <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>', { title: 'Test Component animation', width: 500, height: 300, layout: { type: 'hbox', align: 'stretch' }, items: [{ title: 'Left: 33%', margins: '5 0 5 5', flex: 1 }, { title: 'Left: 66%', margins: '5 5 5 5', flex: 2 }] }); myWindow.show(); myWindow.header.el.on('click', function() { myWindow.animate({ to: { width: (myWindow.getWidth() == 500) ? 700 : 500, height: (myWindow.getHeight() == 300) ? 400 : 300, } }); }); </code></pre> <p>For performance reasons, by default, the internal layout is only updated when the Window reaches its final <code>"to"</code> size. If dynamic updating of the Window's child Components is required, then configure the animation with <code>dynamic: true</code> and the two child items will maintain their proportions during the animation.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all items from the collection. Fires the <a href="#!/api/Ext.util.AbstractMixedCollection-event-clear" rel="Ext.util.AbstractMixedCollection-event-clear" class="docClass">clear</a> event when complete.</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Creates a shallow copy of this collection</p> <p>Collects unique values of a particular property in this MixedCollection</p> <p>Returns true if the collection contains the passed Object as an item.</p> <p>Returns true if the collection contains the passed Object as a key.</p> <p>Creates all the individual sprites for this legend item</p> <p>Destroys the SpriteGroup</p> <p>Executes the specified function once for every item in the collection, passing the following arguments:</p> <div class="mdetail-params"><ul> <li><b>item</b> : Mixed<p class="sub-desc">The collection item</p></li> <li><b>index</b> : Number<p class="sub-desc">The item's index</p></li> <li><b>length</b> : Number<p class="sub-desc">The total number of items in the collection</p></li> </ul></div> <p>The function should return a boolean value. Returning false from the function will stop the iteration.</p> <p>Executes the specified function once for every key in the collection, passing each key, and its associated item as the first two parameters.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Filters the objects in this collection by a set of <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Filter</a>s, or by a single property/value pair with optional parameters for substring matching and case sensitivity. See <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Filter</a> for an example of using Filter objects (preferred). Alternatively, MixedCollection can be easily filtered by property like this:</p> <pre><code>//create a simple store with a few people defined var people = new <a href="#!/api/Ext.util.MixedCollection" rel="Ext.util.MixedCollection" class="docClass">Ext.util.MixedCollection</a>(); people.addAll([ {id: 1, age: 25, name: 'Ed'}, {id: 2, age: 24, name: 'Tommy'}, {id: 3, age: 24, name: 'Arne'}, {id: 4, age: 26, name: 'Aaron'} ]); //a new MixedCollection containing only the items where age == 24 var middleAged = people.filter('age', 24); </code></pre> <p>Filter by a function. Returns a <i>new</i> collection that has been filtered. The passed function will be called with each object in the collection. If the function returns true, the value is included otherwise it is filtered.</p> <p>Returns the first item in the collection which elicits a true return value from the passed selection function.</p> <p>Finds the index of the first matching object in this collection by a specific property/value.</p> <p>Find the index of the first matching object in this collection by a function. If the function returns <i>true</i> it is considered a match.</p> <p>Calculates the insertion index of the new item based upon the comparison function passed, or the current sort order.</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Returns the first item in the collection.</p> <p>Returns a comparator function which compares two items and returns -1, 0, or 1 depending on the currently defined set of <a href="#!/api/Ext.util.Sortable-property-sorters" rel="Ext.util.Sortable-property-sorters" class="docClass">sorters</a>.</p> <p>If there are no <a href="#!/api/Ext.util.Sortable-property-sorters" rel="Ext.util.Sortable-property-sorters" class="docClass">sorters</a> defined, it returns a function which returns <code>0</code> meaning that no sorting will occur.</p> <p>Returns the item associated with the passed key OR index. Key has priority over index. This is the equivalent of calling <a href="#!/api/Ext.util.AbstractMixedCollection-method-getByKey" rel="Ext.util.AbstractMixedCollection-method-getByKey" class="docClass">getByKey</a> first, then if nothing matched calling <a href="#!/api/Ext.util.AbstractMixedCollection-method-getAt" rel="Ext.util.AbstractMixedCollection-method-getAt" class="docClass">getAt</a>.</p> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Returns the item at the specified index.</p> <p>Returns the group bounding box. Behaves like <a href="#!/api/Ext.draw.Sprite-method-getBBox" rel="Ext.draw.Sprite-method-getBBox" class="docClass">Ext.draw.Sprite.getBBox</a> method.</p> <p>Returns the item associated with the passed key.</p> <p>Returns the number of items in the collection.</p> <p>MixedCollection has a generic way to fetch keys if you implement getKey. The default implementation simply returns <b><code>item.id</code></b> but you can provide your own implementation to return a different value as in the following examples:</p> <pre><code>// normal way var mc = new <a href="#!/api/Ext.util.MixedCollection" rel="Ext.util.MixedCollection" class="docClass">Ext.util.MixedCollection</a>(); mc.add(someEl.dom.id, someEl); mc.add(otherEl.dom.id, otherEl); //and so on // using getKey var mc = new <a href="#!/api/Ext.util.MixedCollection" rel="Ext.util.MixedCollection" class="docClass">Ext.util.MixedCollection</a>(); mc.getKey = function(el){ return el.dom.id; }; mc.add(someEl); mc.add(otherEl); // or via the constructor var mc = new <a href="#!/api/Ext.util.MixedCollection" rel="Ext.util.MixedCollection" class="docClass">Ext.util.MixedCollection</a>(false, function(el){ return el.dom.id; }); mc.add(someEl); mc.add(otherEl); </code></pre> <p>Returns a range of items in this collection</p> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Hides all sprites. If the first parameter of the method is true then a redraw will be forced for each sprite.</p> <p>Returns index within the collection of the passed Object.</p> <p>Returns index within the collection of the passed key.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Performs initialization of this mixin. Component classes using this mixin should call this method during their own initialization.</p> <p>Inserts an item at the specified index in the collection. Fires the <a href="#!/api/Ext.util.AbstractMixedCollection-event-add" rel="Ext.util.AbstractMixedCollection-event-add" class="docClass">add</a> event when complete.</p> <p>Returns the last item in the collection.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Remove an item from the collection.</p> <p>Remove all items in the passed array from the collection.</p> <p>Remove an item from a specified index in the collection. Fires the <a href="#!/api/Ext.util.AbstractMixedCollection-event-remove" rel="Ext.util.AbstractMixedCollection-event-remove" class="docClass">remove</a> event when complete.</p> <p>Removed an item associated with the passed key fom the collection.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Reorders each of the items based on a mapping from old index to new index. Internally this just translates into a sort. The 'sort' event is fired whenever reordering has occured.</p> <p>Replaces an item in the collection. Fires the <a href="#!/api/Ext.util.AbstractMixedCollection-event-replace" rel="Ext.util.AbstractMixedCollection-event-replace" class="docClass">replace</a> event when complete.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Ensures that all effects queued after sequenceFx is called on this object are run in sequence. This is the opposite of <a href="#!/api/Ext.util.Animate-method-syncFx" rel="Ext.util.Animate-method-syncFx" class="docClass">syncFx</a>.</p> <p>Iterates through all sprites calling <code>setAttributes</code> on each one. For more information <a href="#!/api/Ext.draw.Sprite" rel="Ext.draw.Sprite" class="docClass">Ext.draw.Sprite</a> provides a description of the attributes that can be set with this method.</p> <p>Shows all sprites. If the first parameter of the method is true then a redraw will be forced for each sprite.</p> <p>Sorts the data in the Store by one or more of its properties. Example usage:</p> <pre><code>//sort by a single field myStore.sort('myField', 'DESC'); //sorting by multiple fields myStore.sort([ { property : 'age', direction: 'ASC' }, { property : 'name', direction: 'DESC' } ]); </code></pre> <p>Internally, Store converts the passed arguments into an array of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Ext.util.Sorter</a> instances, and delegates the actual sorting to its internal <a href="#!/api/Ext.util.MixedCollection" rel="Ext.util.MixedCollection" class="docClass">Ext.util.MixedCollection</a>.</p> <p>When passing a single string argument to sort, Store maintains a ASC/DESC toggler per field, so this code:</p> <pre><code>store.sort('myField'); store.sort('myField'); </code></pre> <p>Is equivalent to this code, because Store handles the toggling automatically:</p> <pre><code>store.sort('myField', 'ASC'); store.sort('myField', 'DESC'); </code></pre> <p>Sorts the collection by a single sorter function</p> <p>Sorts this collection by <b>key</b>s.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Collects all of the values of the given property and returns their sum</p> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Ensures that all effects queued after syncFx is called on this object are run concurrently. This is the opposite of <a href="#!/api/Ext.util.Animate-method-sequenceFx" rel="Ext.util.Animate-method-sequenceFx" class="docClass">sequenceFx</a>.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Update the positions of all this item's sprites to match the root position of the legend box.</p> <p>Creates new Mask.</p> <p>Config object.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Restores the zoom to the original value. This can be used to reset the previous zoom state set by <code>setZoom</code>. For example:</p> <pre><code>myChart.restoreZoom(); </code></pre> <p>Zooms the chart to the specified selection range. Can be used with a selection mask. For example:</p> <pre><code>items: { xtype: 'chart', animate: true, store: store1, mask: 'horizontal', listeners: { select: { fn: function(me, selection) { me.setZoom(selection); me.mask.hide(); } } } } </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>The field used to access the x axis value from the items from the data source.</p> <p>The field used to access the y-axis value from the items from the data source.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Draws the series for the current chart.</p> <p>Iterate over each of the records for this series. The default implementation simply iterates through the entire data store, but individual series implementations can override this to provide custom handling, e.g. adding/removing records.</p> <p>Iterates over a given record's values for each of this series's yFields, executing a given function for each value. Any yFields that have been combined via legend drag-drop will be treated as a single value.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>For a given x/y point relative to the Surface, find a corresponding item from this series, if any.</p> <p>Returns the color of the series (to be displayed as color for the series legend item).</p> <p>Calculate the min and max values for this series's xField.</p> <p>Calculate the min and max values for this series's yField(s). Takes into account yField combinations, exclusions, and stacking.</p> <p>Return the number of records being displayed in this series. Defaults to the number of records in the store; individual series implementations can override to provide custom handling.</p> <p>Returns an array of functions, each of which returns the value of the yField corresponding to function's index in the array, for a given record (each function takes the record as its only argument.) If yFields have been combined by the user via legend drag-drop, this list of accessors will be kept in sync with those combinations.</p> <p>Returns the number of yField values, taking into account fields combined via legend drag-drop.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Hides all the elements in the series.</p> <p>Highlight the given series item.</p> <p>Highlight the specified item. If no item is provided the whole series will be highlighted.</p> <p>Highlight this entire series.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Determines whether the series item at the given index has been excluded, i.e. toggled off in the legend.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Changes the value of the <a href="#!/api/Ext.chart.series.Series-cfg-title" rel="Ext.chart.series.Series-cfg-title" class="docClass">title</a> for the series. Arguments can take two forms:</p> <ul> <li>A single String value: this will be used as the new single title for the series (applies to series with only one yField)</li> <li>A numeric index and a String value: this will set the title for a single indexed yField.</li> </ul> <p>Shows all the elements in the series.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Un-highlights the specified item. If no item is provided it will un-highlight the entire series.</p> <p>UnHighlight this entire series.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>The field used to access the x axis value from the items from the data source.</p> <p>The field used to access the y-axis value from the items from the data source.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Draws the series for the current chart.</p> <p>Iterate over each of the records for this series. The default implementation simply iterates through the entire data store, but individual series implementations can override this to provide custom handling, e.g. adding/removing records.</p> <p>Iterates over a given record's values for each of this series's yFields, executing a given function for each value. Any yFields that have been combined via legend drag-drop will be treated as a single value.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>For a given x/y point relative to the Surface, find a corresponding item from this series, if any.</p> <p>Returns a string with the color to be used for the series legend item.</p> <p>Calculate the min and max values for this series's xField.</p> <p>Calculate the min and max values for this series's yField(s). Takes into account yField combinations, exclusions, and stacking.</p> <p>Return the number of records being displayed in this series. Defaults to the number of records in the store; individual series implementations can override to provide custom handling.</p> <p>Returns an array of functions, each of which returns the value of the yField corresponding to function's index in the array, for a given record (each function takes the record as its only argument.) If yFields have been combined by the user via legend drag-drop, this list of accessors will be kept in sync with those combinations.</p> <p>Returns the number of yField values, taking into account fields combined via legend drag-drop.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Hides all the elements in the series.</p> <p>Highlight the given series item.</p> <p>Highlight the given series item.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Determines whether the series item at the given index has been excluded, i.e. toggled off in the legend.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Changes the value of the <a href="#!/api/Ext.chart.series.Series-cfg-title" rel="Ext.chart.series.Series-cfg-title" class="docClass">title</a> for the series. Arguments can take two forms:</p> <ul> <li>A single String value: this will be used as the new single title for the series (applies to series with only one yField)</li> <li>A numeric index and a String value: this will set the title for a single indexed yField.</li> </ul> <p>Shows all the elements in the series.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Un-highlight any existing highlights</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>The field used to access the x axis value from the items from the data source.</p> <p>The field used to access the y-axis value from the items from the data source.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Iterate over each of the records for this series. The default implementation simply iterates through the entire data store, but individual series implementations can override this to provide custom handling, e.g. adding/removing records.</p> <p>Iterates over a given record's values for each of this series's yFields, executing a given function for each value. Any yFields that have been combined via legend drag-drop will be treated as a single value.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>For a given x/y point relative to the Surface, find a corresponding item from this series, if any.</p> <p>Returns a string with the color to be used for the series legend item.</p> <p>Calculate the min and max values for this series's xField.</p> <p>Calculate the min and max values for this series's yField(s). Takes into account yField combinations, exclusions, and stacking.</p> <p>Return the number of records being displayed in this series. Defaults to the number of records in the store; individual series implementations can override to provide custom handling.</p> <p>Returns an array of functions, each of which returns the value of the yField corresponding to function's index in the array, for a given record (each function takes the record as its only argument.) If yFields have been combined by the user via legend drag-drop, this list of accessors will be kept in sync with those combinations.</p> <p>Returns the number of yField values, taking into account fields combined via legend drag-drop.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Hides all the elements in the series.</p> <p>Highlight the given series item.</p> <p>Highlight the given series item.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Determines whether the series item at the given index has been excluded, i.e. toggled off in the legend.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Changes the value of the <a href="#!/api/Ext.chart.series.Series-cfg-title" rel="Ext.chart.series.Series-cfg-title" class="docClass">title</a> for the series. Arguments can take two forms:</p> <ul> <li>A single String value: this will be used as the new single title for the series (applies to series with only one yField)</li> <li>A numeric index and a String value: this will set the title for a single indexed yField.</li> </ul> <p>Shows all the elements in the series.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Un-highlight any existing highlights</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>The field used to access the x axis value from the items from the data source.</p> <p>The field used to access the y-axis value from the items from the data source.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Draws the series for the current chart.</p> <p>Iterate over each of the records for this series. The default implementation simply iterates through the entire data store, but individual series implementations can override this to provide custom handling, e.g. adding/removing records.</p> <p>Iterates over a given record's values for each of this series's yFields, executing a given function for each value. Any yFields that have been combined via legend drag-drop will be treated as a single value.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>For a given x/y point relative to the Surface, find a corresponding item from this series, if any.</p> <p>Returns a string with the color to be used for the series legend item.</p> <p>Calculate the min and max values for this series's xField.</p> <p>Calculate the min and max values for this series's yField(s). Takes into account yField combinations, exclusions, and stacking.</p> <p>Return the number of records being displayed in this series. Defaults to the number of records in the store; individual series implementations can override to provide custom handling.</p> <p>Returns an array of functions, each of which returns the value of the yField corresponding to function's index in the array, for a given record (each function takes the record as its only argument.) If yFields have been combined by the user via legend drag-drop, this list of accessors will be kept in sync with those combinations.</p> <p>Returns the number of yField values, taking into account fields combined via legend drag-drop.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Hides all the elements in the series.</p> <p>Highlight the given series item.</p> <p>Highlight the given series item.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Determines whether the series item at the given index has been excluded, i.e. toggled off in the legend.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Changes the value of the <a href="#!/api/Ext.chart.series.Series-cfg-title" rel="Ext.chart.series.Series-cfg-title" class="docClass">title</a> for the series. Arguments can take two forms:</p> <ul> <li>A single String value: this will be used as the new single title for the series (applies to series with only one yField)</li> <li>A numeric index and a String value: this will set the title for a single indexed yField.</li> </ul> <p>Shows all the elements in the series.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Un-highlight any existing highlights</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Draws the series for the current chart.</p> <p>Iterate over each of the records for this series. The default implementation simply iterates through the entire data store, but individual series implementations can override this to provide custom handling, e.g. adding/removing records.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>For a given x/y point relative to the Surface, find a corresponding item from this series, if any.</p> <p>Returns the color of the series (to be displayed as color for the series legend item).</p> <p>Return the number of records being displayed in this series. Defaults to the number of records in the store; individual series implementations can override to provide custom handling.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Hides all the elements in the series.</p> <p>Highlight the given series item.</p> <p>Highlight the given series item.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Determines whether the series item at the given index has been excluded, i.e. toggled off in the legend.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Changes the value of the <a href="#!/api/Ext.chart.series.Series-cfg-title" rel="Ext.chart.series.Series-cfg-title" class="docClass">title</a> for the series. Arguments can take two forms:</p> <ul> <li>A single String value: this will be used as the new single title for the series (applies to series with only one yField)</li> <li>A numeric index and a String value: this will set the title for a single indexed yField.</li> </ul> <p>Sets the Gauge chart to the current specified value.</p> <p>Shows all the elements in the series.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Un-highlight any existing highlights</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>The field used to access the x axis value from the items from the data source.</p> <p>The field used to access the y-axis value from the items from the data source.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Draws the series for the current chart.</p> <p>Iterate over each of the records for this series. The default implementation simply iterates through the entire data store, but individual series implementations can override this to provide custom handling, e.g. adding/removing records.</p> <p>Iterates over a given record's values for each of this series's yFields, executing a given function for each value. Any yFields that have been combined via legend drag-drop will be treated as a single value.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>For a given x/y point relative to the Surface, find a corresponding item from this series, if any.</p> <p>Returns a string with the color to be used for the series legend item.</p> <p>Calculate the min and max values for this series's xField.</p> <p>Calculate the min and max values for this series's yField(s). Takes into account yField combinations, exclusions, and stacking.</p> <p>Return the number of records being displayed in this series. Defaults to the number of records in the store; individual series implementations can override to provide custom handling.</p> <p>Returns an array of functions, each of which returns the value of the yField corresponding to function's index in the array, for a given record (each function takes the record as its only argument.) If yFields have been combined by the user via legend drag-drop, this list of accessors will be kept in sync with those combinations.</p> <p>Returns the number of yField values, taking into account fields combined via legend drag-drop.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Hides all the elements in the series.</p> <p>Highlight the given series item.</p> <p>Highlight the given series item.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Determines whether the series item at the given index has been excluded, i.e. toggled off in the legend.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Changes the value of the <a href="#!/api/Ext.chart.series.Series-cfg-title" rel="Ext.chart.series.Series-cfg-title" class="docClass">title</a> for the series. Arguments can take two forms:</p> <ul> <li>A single String value: this will be used as the new single title for the series (applies to series with only one yField)</li> <li>A numeric index and a String value: this will set the title for a single indexed yField.</li> </ul> <p>Shows all the elements in the series.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Un-highlight any existing highlights</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Draws the series for the current chart.</p> <p>Iterate over each of the records for this series. The default implementation simply iterates through the entire data store, but individual series implementations can override this to provide custom handling, e.g. adding/removing records.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>For a given x/y point relative to the Surface, find a corresponding item from this series, if any.</p> <p>Returns the color of the series (to be displayed as color for the series legend item).</p> <p>Return the number of records being displayed in this series. Defaults to the number of records in the store; individual series implementations can override to provide custom handling.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Hides all the elements in the series.</p> <p>Highlight the given series item.</p> <p>Highlight the specified item. If no item is provided the whole series will be highlighted.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Determines whether the series item at the given index has been excluded, i.e. toggled off in the legend.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Changes the value of the <a href="#!/api/Ext.chart.series.Series-cfg-title" rel="Ext.chart.series.Series-cfg-title" class="docClass">title</a> for the series. Arguments can take two forms:</p> <ul> <li>A single String value: this will be used as the new single title for the series (applies to series with only one yField)</li> <li>A numeric index and a String value: this will set the title for a single indexed yField.</li> </ul> <p>Shows all the elements in the series.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Un-highlights the specified item. If no item is provided it will un-highlight the entire series.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Draws the series for the current chart.</p> <p>Iterate over each of the records for this series. The default implementation simply iterates through the entire data store, but individual series implementations can override this to provide custom handling, e.g. adding/removing records.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>For a given x/y point relative to the Surface, find a corresponding item from this series, if any.</p> <p>Returns a string with the color to be used for the series legend item.</p> <p>Return the number of records being displayed in this series. Defaults to the number of records in the store; individual series implementations can override to provide custom handling.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Hides all the elements in the series.</p> <p>Highlight the given series item.</p> <p>Highlight the given series item.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Determines whether the series item at the given index has been excluded, i.e. toggled off in the legend.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Changes the value of the <a href="#!/api/Ext.chart.series.Series-cfg-title" rel="Ext.chart.series.Series-cfg-title" class="docClass">title</a> for the series. Arguments can take two forms:</p> <ul> <li>A single String value: this will be used as the new single title for the series (applies to series with only one yField)</li> <li>A numeric index and a String value: this will set the title for a single indexed yField.</li> </ul> <p>Shows all the elements in the series.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Un-highlight any existing highlights</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>The field used to access the x axis value from the items from the data source.</p> <p>The field used to access the y-axis value from the items from the data source.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Draws the series for the current chart.</p> <p>Iterate over each of the records for this series. The default implementation simply iterates through the entire data store, but individual series implementations can override this to provide custom handling, e.g. adding/removing records.</p> <p>Iterates over a given record's values for each of this series's yFields, executing a given function for each value. Any yFields that have been combined via legend drag-drop will be treated as a single value.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>For a given x/y point relative to the Surface, find a corresponding item from this series, if any.</p> <p>Returns a string with the color to be used for the series legend item.</p> <p>Calculate the min and max values for this series's xField.</p> <p>Calculate the min and max values for this series's yField(s). Takes into account yField combinations, exclusions, and stacking.</p> <p>Return the number of records being displayed in this series. Defaults to the number of records in the store; individual series implementations can override to provide custom handling.</p> <p>Returns an array of functions, each of which returns the value of the yField corresponding to function's index in the array, for a given record (each function takes the record as its only argument.) If yFields have been combined by the user via legend drag-drop, this list of accessors will be kept in sync with those combinations.</p> <p>Returns the number of yField values, taking into account fields combined via legend drag-drop.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Hides all the elements in the series.</p> <p>Highlight the given series item.</p> <p>Highlight the given series item.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Determines whether the series item at the given index has been excluded, i.e. toggled off in the legend.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Changes the value of the <a href="#!/api/Ext.chart.series.Series-cfg-title" rel="Ext.chart.series.Series-cfg-title" class="docClass">title</a> for the series. Arguments can take two forms:</p> <ul> <li>A single String value: this will be used as the new single title for the series (applies to series with only one yField)</li> <li>A numeric index and a String value: this will set the title for a single indexed yField.</li> </ul> <p>Shows all the elements in the series.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Un-highlight any existing highlights</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Iterate over each of the records for this series. The default implementation simply iterates through the entire data store, but individual series implementations can override this to provide custom handling, e.g. adding/removing records.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>For a given x/y point relative to the Surface, find a corresponding item from this series, if any.</p> <p>Returns a string with the color to be used for the series legend item.</p> <p>Return the number of records being displayed in this series. Defaults to the number of records in the store; individual series implementations can override to provide custom handling.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Hides all the elements in the series.</p> <p>Highlight the given series item.</p> <p>Highlight the given series item.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Determines whether the series item at the given index has been excluded, i.e. toggled off in the legend.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Changes the value of the <a href="#!/api/Ext.chart.series.Series-cfg-title" rel="Ext.chart.series.Series-cfg-title" class="docClass">title</a> for the series. Arguments can take two forms:</p> <ul> <li>A single String value: this will be used as the new single title for the series (applies to series with only one yField)</li> <li>A numeric index and a String value: this will set the title for a single indexed yField.</li> </ul> <p>Shows all the elements in the series.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Un-highlight any existing highlights</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Creates new Component.</p> <p>The configuration options may be specified as either:</p> <ul> <li><strong>an element</strong> : it is set as the internal element and its id used as the component id</li> <li><strong>a string</strong> : it is assumed to be the id of an existing element and is used as the component id</li> <li><strong>anything else</strong> : it is assumed to be a standard config object and is applied to the component</li> </ul> <p>Setting this property to <code>true</code> causes the <a href="#!/api/Ext.AbstractComponent-method-isLayoutRoot" rel="Ext.AbstractComponent-method-isLayoutRoot" class="docClass">isLayoutRoot</a> method to return <code>true</code> and stop the search for the top-most component for a layout.</p> <p>Indicates whether or not the component can be dragged.</p> <p>Only present for <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which were inserted as descendant items of floating Containers.</p> <p>Floating Components that are programatically <a href="#!/api/Ext.Component-event-render" rel="Ext.Component-event-render" class="docClass">rendered</a> will not have a <code>floatParent</code> property.</p> <p>For <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which are child items of a Container, the floatParent will be the floating ancestor Container which is responsible for the base z-index value of all its floating descendants. It provides a <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a> which provides z-indexing services for all its descendant floating Components.</p> <p>For example, the dropdown <a href="#!/api/Ext.view.BoundList" rel="Ext.view.BoundList" class="docClass">BoundList</a> of a ComboBox which is in a Window will have the Window as its <code>floatParent</code></p> <p>See <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> and <a href="#!/api/Ext.Component-property-zIndexManager" rel="Ext.Component-property-zIndexManager" class="docClass">zIndexManager</a></p> <p>Indicates the width of any framing elements which were added within the encapsulating element to provide graphical, rounded borders. See the <a href="#!/api/Ext.AbstractComponent-cfg-frame" rel="Ext.AbstractComponent-cfg-frame" class="docClass">frame</a> config.</p> <p>This is an object containing the frame width in pixels for all four sides of the Component containing the following properties:</p> <p>This is an internal flag that you use when creating custom components. By default this is set to true which means that every component gets a mask when its disabled. Components like FieldContainer, FieldSet, Field, Button, Tab override this property to false since they want to implement custom disable logic.</p> <p>This Component's owner <a href="#!/api/Ext.container.Container" rel="Ext.container.Container" class="docClass">Container</a> (is set automatically when this Component is added to a Container).</p> <p><strong>Note</strong>: to access items within the Container see <a href="#!/api/Ext.AbstractComponent-cfg-itemId" rel="Ext.AbstractComponent-cfg-itemId" class="docClass">itemId</a>.</p> <p>Indicates whether or not the component has been rendered.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Only present for <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components after they have been rendered.</p> <p>A reference to the ZIndexManager which is managing this Component's z-index.</p> <p>The <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a> maintains a stack of floating Component z-indices, and also provides a single modal mask which is insert just beneath the topmost visible modal floating Component.</p> <p>Floating Components may be <a href="#!/api/Ext.Component-method-toFront" rel="Ext.Component-method-toFront" class="docClass">brought to the front</a> or <a href="#!/api/Ext.Component-method-toBack" rel="Ext.Component-method-toBack" class="docClass">sent to the back</a> of the z-index stack.</p> <p>This defaults to the global <a href="#!/api/Ext.WindowManager" rel="Ext.WindowManager" class="docClass">ZIndexManager</a> for floating Components that are programatically <a href="#!/api/Ext.Component-event-render" rel="Ext.Component-event-render" class="docClass">rendered</a>.</p> <p>For <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which are added to a Container, the ZIndexManager is acquired from the first ancestor Container found which is floating, or if not found the global <a href="#!/api/Ext.WindowManager" rel="Ext.WindowManager" class="docClass">ZIndexManager</a> is used.</p> <p>See <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> and <a href="#!/api/Ext.Component-property-floatParent" rel="Ext.Component-property-floatParent" class="docClass">floatParent</a></p> <p>Adds each argument passed to this method to the childEls array.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-addUIClsToElement" rel="Ext.AbstractComponent-method-addUIClsToElement" class="docClass">addUIClsToElement</a> and adds to all elements of this component.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Save a property to the given state object if it is not its default or configured value.</p> <p>Add events that will trigger the state to be saved. If the first argument is an array, each element of that array is the name of a state event. Otherwise, each argument passed to this method is the name of a state event.</p> <p>Method which adds a specified UI + uiCls to the components element. Can be overridden to remove the UI from more than just the components element.</p> <p>Called by the layout system when the Component has been layed out.</p> <p>Aligns this floating Component to the specified element</p> <p>Perform custom animation on this object.</p> <p>This method is applicable to both the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a> class and the <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a> class. It performs animated transitions of certain properties of this object over a specified timeline.</p> <p>The sole parameter is an object which specifies start property values, end property values, and properties which describe the timeline.</p> <h3>Animating an <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a></h3> <p>When animating an Element, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The page X position in pixels.</p></li> <li><p><code>y</code> - The page Y position in pixels</p></li> <li><p><code>left</code> - The element's CSS <code>left</code> value. Units must be supplied.</p></li> <li><p><code>top</code> - The element's CSS <code>top</code> value. Units must be supplied.</p></li> <li><p><code>width</code> - The element's CSS <code>width</code> value. Units must be supplied.</p></li> <li><p><code>height</code> - The element's CSS <code>height</code> value. Units must be supplied.</p></li> <li><p><code>scrollLeft</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>scrollTop</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>opacity</code> - The element's <code>opacity</code> value. This must be a value between <code>0</code> and <code>1</code>.</p></li> </ul> <p><strong>Be aware than animating an Element which is being used by an Ext Component without in some way informing the Component about the changed element state will result in incorrect Component behaviour. This is because the Component will be using the old state of the element. To avoid this problem, it is now possible to directly animate certain properties of Components.</strong></p> <h3>Animating a <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a></h3> <p>When animating a Component, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The Component's page X position in pixels.</p></li> <li><p><code>y</code> - The Component's page Y position in pixels</p></li> <li><p><code>left</code> - The Component's <code>left</code> value in pixels.</p></li> <li><p><code>top</code> - The Component's <code>top</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>dynamic</code> - Specify as true to update the Component's layout (if it is a Container) at every frame of the animation. <em>Use sparingly as laying out on every intermediate size change is an expensive operation.</em></p></li> </ul> <p>For example, to animate a Window to a new size, ensuring that its internal layout, and any shadow is correct:</p> <pre><code>myWindow = <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>', { title: 'Test Component animation', width: 500, height: 300, layout: { type: 'hbox', align: 'stretch' }, items: [{ title: 'Left: 33%', margins: '5 0 5 5', flex: 1 }, { title: 'Left: 66%', margins: '5 5 5 5', flex: 2 }] }); myWindow.show(); myWindow.header.el.on('click', function() { myWindow.animate({ to: { width: (myWindow.getWidth() == 500) ? 700 : 500, height: (myWindow.getHeight() == 300) ? 400 : 300, } }); }); </code></pre> <p>For performance reasons, by default, the internal layout is only updated when the Window reaches its final <code>"to"</code> size. If dynamic updating of the Window's child Components is required, then configure the animation with <code>dynamic: true</code> and the two child items will maintain their proportions during the animation.</p> <p>Applies the state to the object. This should be overridden in subclasses to do more complex state operations. By default it applies the state properties onto the current object.</p> <p>Utility wrapper that suspends layouts of all components for the duration of a given function.</p> <p>Occurs before componentLayout is run. Returning false from this method will prevent the componentLayout from being executed.</p> <p>Bubbles up the component/container heirarchy, calling the specified function with each component. The scope (<em>this</em>) of function call will be the scope provided or the current component. The arguments to the function will be the args provided or the current component. If the function returns false at any point, the bubble is stopped.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Center this Component in its container.</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Clone the current component using the original config values passed into this instance by default.</p> <p>Ensures that the plugins array contains fully constructed plugin instances. This converts any configs into their appropriate instances.</p> <p>Create the Surface instance. Resolves the correct Surface implementation to instantiate based on the 'enginePriority' config. Once the Surface instance is created you can use the handle to that instance to add sprites. For example:</p> <pre><code>drawComponent.surface.add(sprite); </code></pre> <p>Destroys the Component.</p> <p>Disable the component.</p> <p>Handles autoRender. Floating Components may have an ownerCt. If they are asking to be constrained, constrain them within that ownerCt, and have their z-index managed locally. Floating Components are always rendered to document.body</p> <p>This method needs to be called whenever you change something on this component that requires the Component's layout to be recalculated.</p> <p>Moves this floating Component into a constrain region.</p> <p>By default, this Component is constrained to be within the container it was added to, or the element it was rendered to.</p> <p>An alternative constraint may be passed.</p> <p>Enable the component</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Ensures that this component is attached to <code>document.body</code>. If the component was rendered to Ext.getDetachedBody, then it will be appended to <code>document.body</code>. Any configured position is also restored.</p> <p>Find a container above this component at any level by a custom function. If the passed function returns true, the container will be returned.</p> <p>Find a container above this component at any level by xtype or class</p> <p>See also the <a href="#!/api/Ext.Component-method-up" rel="Ext.Component-method-up" class="docClass">up</a> method.</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Try to focus this component.</p> <p>Forces this component to redo its componentLayout.</p> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Gets the current box measurements of the component's underlying element.</p> <p>Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy.</p> <p>Retrieves the top level element representing this component.</p> <p>Gets the current height of the component's underlying element.</p> <p>Retrieves the id of this component. Will autogenerate an id if one has not already been set.</p> <p>This function takes the position argument passed to onRender and returns a DOM element that you can use in the insertBefore.</p> <p>Gets the <a href="#!/api/Ext.ComponentLoader" rel="Ext.ComponentLoader" class="docClass">Ext.ComponentLoader</a> for this Component.</p> <p>Retrieves a plugin by its pluginId which has been bound to this component.</p> <p>Gets the current XY position of the component's underlying element.</p> <p>Gets the current size of the component's underlying element.</p> <p>Returns an object that describes how this component's width and height is managed. These objects are shared and should not be modified.</p> <p>The supplied default state gathering method for the AbstractComponent class.</p> <p>This method returns dimension settings such as <code>flex</code>, <code>anchor</code>, <code>width</code> and <code>height</code> along with <code>collapsed</code> state.</p> <p>Subclasses which implement more complex state should call the superclass's implementation, and apply their state to the result if this basic state is to be saved.</p> <p>Note that Component state will only be saved if the Component has a <a href="#!/api/Ext.AbstractComponent-cfg-stateId" rel="Ext.AbstractComponent-cfg-stateId" class="docClass">stateId</a> and there as a StateProvider configured for the document.</p> <p>Gets the state id for this object.</p> <p>Gets the current width of the component's underlying element.</p> <p>Gets the xtype for this component as registered with <a href="#!/api/Ext.ComponentManager" rel="Ext.ComponentManager" class="docClass">Ext.ComponentManager</a>. For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header. Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); alert(t.getXType()); // alerts 'textfield' </code></pre> <p>Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); alert(t.getXTypes()); // alerts 'component/field/textfield' </code></pre> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Checks if the specified CSS class exists on this element's DOM node.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Checks if there is currently a specified uiCls</p> <p>Hides this Component, setting it to invisible using the configured <a href="#!/api/Ext.Component-cfg-hideMode" rel="Ext.Component-cfg-hideMode" class="docClass">hideMode</a>.</p> <p>The initComponent template method is an important initialization step for a Component. It is intended to be implemented by each subclass of <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> to provide any needed constructor logic. The initComponent method of the class being created is called first, with each initComponent method up the hierarchy to <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> being called thereafter. This makes it easy to implement and, if needed, override the constructor logic of the Component at any step in the hierarchy.</p> <p>The initComponent method <strong>must</strong> contain a call to <a href="#!/api/Ext.Base-method-callParent" rel="Ext.Base-method-callParent" class="docClass">callParent</a> in order to ensure that the parent class' initComponent method is also called.</p> <p>All config options passed to the constructor are applied to <code>this</code> before initComponent is called, so you can simply access them with <code>this.someOption</code>.</p> <p>The following example demonstrates using a dynamic string for the text of a button at the time of instantiation of the class.</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('DynamicButtonText', { extend: '<a href="#!/api/Ext.button.Button" rel="Ext.button.Button" class="docClass">Ext.button.Button</a>', initComponent: function() { this.text = new Date(); this.renderTo = <a href="#!/api/Ext-method-getBody" rel="Ext-method-getBody" class="docClass">Ext.getBody</a>(); this.callParent(); } }); <a href="#!/api/Ext-method-onReady" rel="Ext-method-onReady" class="docClass">Ext.onReady</a>(function() { <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('DynamicButtonText'); }); </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Tests whether this Component matches the selector string.</p> <p>Determines whether this component is the descendant of a particular container.</p> <p>Method to determine whether this Component is currently disabled.</p> <p>Method to determine whether this Component is draggable.</p> <p>Method to determine whether this Component is droppable.</p> <p>Method to determine whether this Component is floating.</p> <p>Method to determine whether this Component is currently set to hidden.</p> <p>Determines whether this Component is the root of a layout. This returns <code>true</code> if this component can run its layout without assistance from or impact on its owner. If this component cannot run its layout given these restrictions, <code>false</code> is returned and its owner will be considered as the next candidate for the layout root.</p> <p>Setting the <a href="#!/api/Ext.AbstractComponent-property-_isLayoutRoot" rel="Ext.AbstractComponent-property-_isLayoutRoot" class="docClass">_isLayoutRoot</a> property to <code>true</code> causes this method to always return <code>true</code>. This may be useful when updating a layout of a Container which shrink wraps content, and you know that it will not change size, and so can safely be the topmost participant in the layout run.</p> <p>Returns true if layout is suspended for this component. This can come from direct suspension of this component's layout activity (suspendLayouts) or if one of this component's containers is suspended.</p> <p>Returns true if this component is visible.</p> <p>Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended from the xtype (default) or whether it is directly of the xtype specified (shallow = true).</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); var isText = t.isXType('textfield'); // true var isBoxSubclass = t.isXType('field'); // true, descended from <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> var isBoxInstance = t.isXType('field', true); // false, not a direct <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> instance </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Returns the next node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextSibling" rel="Ext.AbstractComponent-method-nextSibling" class="docClass">nextSibling</a>.</p> <p>Returns the next sibling of this Component.</p> <p>Optionally selects the next sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>next()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextNode" rel="Ext.AbstractComponent-method-nextNode" class="docClass">nextNode</a></p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Returns the previous node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree in reverse order to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousSibling" rel="Ext.AbstractComponent-method-previousSibling" class="docClass">previousSibling</a>.</p> <p>Returns the previous sibling of this Component.</p> <p>Optionally selects the previous sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>prev()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousNode" rel="Ext.AbstractComponent-method-previousNode" class="docClass">previousNode</a></p> <p>Called by Component#doAutoRender</p> <p>Register a Container configured <code>floating: true</code> with this Component's <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a>.</p> <p>Components added in ths way will not participate in any layout, but will be rendered upon first show in the way that <a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Window</a>s are.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes items in the childEls array based on the return value of a supplied test function. The function is called with a entry in childEls and if the test function return true, that entry is removed. If false, that entry is kept.</p> <p>Removes a CSS class from the top level element representing this component.</p> <p>Removes a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-removeUIClsFromElement" rel="Ext.AbstractComponent-method-removeUIClsFromElement" class="docClass">removeUIClsFromElement</a> and removes it from all elements of this component.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Method which removes a specified UI + uiCls from the components element. The cls which is added to the element will be: <code>this.baseCls + '-' + ui</code></p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Conditionally saves a single property from this object to the given state object. The idea is to only save state which has changed from the initial state so that current software settings do not override future software settings. Only those values that are user-changed state should be saved.</p> <p>Scrolls this Component's target element by the passed delta values, optionally animating.</p> <p>All of the following are equivalent:</p> <pre><code> comp.scrollBy(10, 10, true); comp.scrollBy([10, 10], true); comp.scrollBy({ x: 10, y: 10 }, true); </code></pre> <p>Ensures that all effects queued after sequenceFx is called on this object are run in sequence. This is the opposite of <a href="#!/api/Ext.util.Animate-method-syncFx" rel="Ext.util.Animate-method-syncFx" class="docClass">syncFx</a>.</p> <p>This method is called internally by <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">Ext.ZIndexManager</a> to signal that a floating Component has either been moved to the top of its zIndex stack, or pushed from the top of its zIndex stack.</p> <p>If a <em>Window</em> is superceded by another Window, deactivating it hides its shadow.</p> <p>This method also fires the <a href="#!/api/Ext.Component-event-activate" rel="Ext.Component-event-activate" class="docClass">activate</a> or <a href="#!/api/Ext.Component-event-deactivate" rel="Ext.Component-event-deactivate" class="docClass">deactivate</a> event depending on which action occurred.</p> <p>Sets the overflow on the content element of the component.</p> <p>Enable or disable the component.</p> <p>Sets the dock position of this component in its parent panel. Note that this only has effect if this item is part of the dockedItems collection of a parent that has a DockLayout (note that any Panel has a DockLayout by default)</p> <p>Sets the height of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>This method allows you to show or hide a LoadMask on top of this component.</p> <p>Sets the overflow x/y on the content element of the component. The x/y overflow values can be any valid CSS overflow (e.g., 'auto' or 'scroll'). By default, the value is 'hidden'. Passing null for one of the values will erase the inline style. Passing <code>undefined</code> will preserve the current value.</p> <p>Sets the page XY position of the component. To set the left and top instead, use <a href="#!/api/Ext.Component-method-setPosition" rel="Ext.Component-method-setPosition" class="docClass">setPosition</a>. This method fires the <a href="#!/api/Ext.Component-event-move" rel="Ext.Component-event-move" class="docClass">move</a> event.</p> <p>Sets the left and top of the component. To set the page XY position instead, use setPagePosition. This method fires the <a href="#!/api/Ext.AbstractComponent-event-move" rel="Ext.AbstractComponent-event-move" class="docClass">move</a> event.</p> <p>Sets the width and height of this Component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event. This method can accept either width and height as separate arguments, or you can pass a size object like <code>{width:10, height:20}</code>.</p> <p>Sets the UI for the component. This will remove any existing UIs on the component. It will also loop through any uiCls set on the component and rename them so they include the new UI</p> <p>Convenience function to hide or show this component by boolean.</p> <p>Sets the width of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>Shows this Component, rendering it first if <a href="#!/api/Ext.Component-cfg-autoRender" rel="Ext.Component-cfg-autoRender" class="docClass">autoRender</a> or <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> are <code>true</code>.</p> <p>After being shown, a <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Component (such as a <a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>), is activated it and brought to the front of its <a href="#!/api/Ext.Component-property-zIndexManager" rel="Ext.Component-property-zIndexManager" class="docClass">z-index stack</a>.</p> <p>Displays component at specific xy position. A floating component (like a menu) is positioned relative to its ownerCt if any. Useful for popping up a context menu:</p> <pre><code>listeners: { itemcontextmenu: function(view, record, item, index, event, options) { <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.menu.Menu" rel="Ext.menu.Menu" class="docClass">Ext.menu.Menu</a>', { width: 100, height: 100, margin: '0 0 10 0', items: [{ text: 'regular item 1' },{ text: 'regular item 2' },{ text: 'regular item 3' }] }).showAt(event.getXY()); } } </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Ensures that all effects queued after syncFx is called on this object are run concurrently. This is the opposite of <a href="#!/api/Ext.util.Animate-method-sequenceFx" rel="Ext.util.Animate-method-sequenceFx" class="docClass">sequenceFx</a>.</p> <p>Sends this Component to the back of (lower z-index than) any other visible windows</p> <p>Brings this floating Component to the front of any other visible, floating Components managed by the same <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a></p> <p>If this Component is modal, inserts the modal mask just below this Component in the z-index stack.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Walks up the <code>ownerCt</code> axis looking for an ancestor Container which matches the passed simple selector.</p> <p>Example:</p> <pre><code>var owningTabPanel = grid.up('tabpanel'); </code></pre> <p>Update the content area of a component.</p> <p>Sets the current box measurements of the component's underlying element.</p> <p>Updates this component's layout. If this update effects this components <a href="#!/api/Ext.AbstractComponent-property-ownerCt" rel="Ext.AbstractComponent-property-ownerCt" class="docClass">ownerCt</a>, that component's <code>updateLayout</code> method will be called to perform the layout instead. Otherwise, just this component (and its child items) will layout.</p> <p>Create a new anonymous class.</p> <p>An object represent the properties of this class</p> <p>Optional, the callback function to be executed when this class is fully created. Note that the creation process can be asynchronous depending on the pre-processors used.</p> <p>Defines a class.</p> <p>Retrieve a class by its name.</p> <p>Get the aliases of a class by the class name</p> <p>Get a reference to the class by its alias.</p> <p>Get the class of the provided object; returns null if it's not an instance of any class created with <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>. This is usually invoked by the shorthand <a href="#!/api/Ext-method-getClass" rel="Ext-method-getClass" class="docClass">Ext.getClass</a></p> <pre><code>var component = new <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a>(); <a href="#!/api/Ext.ClassManager-method-getClass" rel="Ext.ClassManager-method-getClass" class="docClass">Ext.ClassManager.getClass</a>(component); // returns <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> </code></pre> <p>Returns the displayName property or className or object. When all else fails, returns "Anonymous".</p> <p>Get the name of the class by its reference or its instance; usually invoked by the shorthand <a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a></p> <pre><code><a href="#!/api/Ext.ClassManager-method-getName" rel="Ext.ClassManager-method-getName" class="docClass">Ext.ClassManager.getName</a>(<a href="#!/api/Ext.Action" rel="Ext.Action" class="docClass">Ext.Action</a>); // returns "<a href="#!/api/Ext.Action" rel="Ext.Action" class="docClass">Ext.Action</a>" </code></pre> <p>Get the name of a class by its alias.</p> <p>Get the name of a class by its alternate name.</p> <p>Converts a string expression to an array of matching class names. An expression can either refers to class aliases or class names. Expressions support wildcards:</p> <pre><code> // returns ['<a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>'] var window = <a href="#!/api/Ext.ClassManager-method-getNamesByExpression" rel="Ext.ClassManager-method-getNamesByExpression" class="docClass">Ext.ClassManager.getNamesByExpression</a>('widget.window'); // returns ['widget.panel', 'widget.window', ...] var allWidgets = <a href="#!/api/Ext.ClassManager-method-getNamesByExpression" rel="Ext.ClassManager-method-getNamesByExpression" class="docClass">Ext.ClassManager.getNamesByExpression</a>('widget.*'); // returns ['<a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>', 'Ext.data.ArrayProxy', ...] var allData = <a href="#!/api/Ext.ClassManager-method-getNamesByExpression" rel="Ext.ClassManager-method-getNamesByExpression" class="docClass">Ext.ClassManager.getNamesByExpression</a>('Ext.data.*'); </code></pre> <p>Instantiate a class by its alias; usually invoked by the convenient shorthand <a href="#!/api/Ext-method-createByAlias" rel="Ext-method-createByAlias" class="docClass">Ext.createByAlias</a> If <a href="#!/api/Ext.Loader" rel="Ext.Loader" class="docClass">Ext.Loader</a> is <a href="#!/api/Ext.Loader-method-setConfig" rel="Ext.Loader-method-setConfig" class="docClass">enabled</a> and the class has not been defined yet, it will attempt to load the class via synchronous loading.</p> <pre><code>var window = <a href="#!/api/Ext.ClassManager-method-instantiateByAlias" rel="Ext.ClassManager-method-instantiateByAlias" class="docClass">Ext.ClassManager.instantiateByAlias</a>('widget.window', { width: 600, height: 800, ... }); </code></pre> <p>Checks if a class has already been created.</p> <p>Sets a name reference to a class.</p> <p>Register the alias for a class.</p> <p>Creates a namespace and assign the <code>value</code> to the created object</p> <pre><code><a href="#!/api/Ext.ClassManager-method-setNamespace" rel="Ext.ClassManager-method-setNamespace" class="docClass">Ext.ClassManager.setNamespace</a>('MyCompany.pkg.Example', someObject); alert(MyCompany.pkg.Example === someObject); // alerts true </code></pre> <p>Creates new Component.</p> <p>The configuration options may be specified as either:</p> <ul> <li><strong>an element</strong> : it is set as the internal element and its id used as the component id</li> <li><strong>a string</strong> : it is assumed to be the id of an existing element and is used as the component id</li> <li><strong>anything else</strong> : it is assumed to be a standard config object and is applied to the component</li> </ul> <p>Setting this property to <code>true</code> causes the <a href="#!/api/Ext.AbstractComponent-method-isLayoutRoot" rel="Ext.AbstractComponent-method-isLayoutRoot" class="docClass">isLayoutRoot</a> method to return <code>true</code> and stop the search for the top-most component for a layout.</p> <p>Indicates whether or not the component can be dragged.</p> <p>Only present for <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which were inserted as descendant items of floating Containers.</p> <p>Floating Components that are programatically <a href="#!/api/Ext.Component-event-render" rel="Ext.Component-event-render" class="docClass">rendered</a> will not have a <code>floatParent</code> property.</p> <p>For <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which are child items of a Container, the floatParent will be the floating ancestor Container which is responsible for the base z-index value of all its floating descendants. It provides a <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a> which provides z-indexing services for all its descendant floating Components.</p> <p>For example, the dropdown <a href="#!/api/Ext.view.BoundList" rel="Ext.view.BoundList" class="docClass">BoundList</a> of a ComboBox which is in a Window will have the Window as its <code>floatParent</code></p> <p>See <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> and <a href="#!/api/Ext.Component-property-zIndexManager" rel="Ext.Component-property-zIndexManager" class="docClass">zIndexManager</a></p> <p>Indicates the width of any framing elements which were added within the encapsulating element to provide graphical, rounded borders. See the <a href="#!/api/Ext.AbstractComponent-cfg-frame" rel="Ext.AbstractComponent-cfg-frame" class="docClass">frame</a> config.</p> <p>This is an object containing the frame width in pixels for all four sides of the Component containing the following properties:</p> <p>This is an internal flag that you use when creating custom components. By default this is set to true which means that every component gets a mask when its disabled. Components like FieldContainer, FieldSet, Field, Button, Tab override this property to false since they want to implement custom disable logic.</p> <p>This Component's owner <a href="#!/api/Ext.container.Container" rel="Ext.container.Container" class="docClass">Container</a> (is set automatically when this Component is added to a Container).</p> <p><strong>Note</strong>: to access items within the Container see <a href="#!/api/Ext.AbstractComponent-cfg-itemId" rel="Ext.AbstractComponent-cfg-itemId" class="docClass">itemId</a>.</p> <p>Indicates whether or not the component has been rendered.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Only present for <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components after they have been rendered.</p> <p>A reference to the ZIndexManager which is managing this Component's z-index.</p> <p>The <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a> maintains a stack of floating Component z-indices, and also provides a single modal mask which is insert just beneath the topmost visible modal floating Component.</p> <p>Floating Components may be <a href="#!/api/Ext.Component-method-toFront" rel="Ext.Component-method-toFront" class="docClass">brought to the front</a> or <a href="#!/api/Ext.Component-method-toBack" rel="Ext.Component-method-toBack" class="docClass">sent to the back</a> of the z-index stack.</p> <p>This defaults to the global <a href="#!/api/Ext.WindowManager" rel="Ext.WindowManager" class="docClass">ZIndexManager</a> for floating Components that are programatically <a href="#!/api/Ext.Component-event-render" rel="Ext.Component-event-render" class="docClass">rendered</a>.</p> <p>For <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which are added to a Container, the ZIndexManager is acquired from the first ancestor Container found which is floating, or if not found the global <a href="#!/api/Ext.WindowManager" rel="Ext.WindowManager" class="docClass">ZIndexManager</a> is used.</p> <p>See <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> and <a href="#!/api/Ext.Component-property-floatParent" rel="Ext.Component-property-floatParent" class="docClass">floatParent</a></p> <p>Adds each argument passed to this method to the childEls array.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-addUIClsToElement" rel="Ext.AbstractComponent-method-addUIClsToElement" class="docClass">addUIClsToElement</a> and adds to all elements of this component.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Save a property to the given state object if it is not its default or configured value.</p> <p>Add events that will trigger the state to be saved. If the first argument is an array, each element of that array is the name of a state event. Otherwise, each argument passed to this method is the name of a state event.</p> <p>Method which adds a specified UI + uiCls to the components element. Can be overridden to remove the UI from more than just the components element.</p> <p>Called by the layout system when the Component has been layed out.</p> <p>Aligns this floating Component to the specified element</p> <p>Perform custom animation on this object.</p> <p>This method is applicable to both the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a> class and the <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a> class. It performs animated transitions of certain properties of this object over a specified timeline.</p> <p>The sole parameter is an object which specifies start property values, end property values, and properties which describe the timeline.</p> <h3>Animating an <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a></h3> <p>When animating an Element, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The page X position in pixels.</p></li> <li><p><code>y</code> - The page Y position in pixels</p></li> <li><p><code>left</code> - The element's CSS <code>left</code> value. Units must be supplied.</p></li> <li><p><code>top</code> - The element's CSS <code>top</code> value. Units must be supplied.</p></li> <li><p><code>width</code> - The element's CSS <code>width</code> value. Units must be supplied.</p></li> <li><p><code>height</code> - The element's CSS <code>height</code> value. Units must be supplied.</p></li> <li><p><code>scrollLeft</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>scrollTop</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>opacity</code> - The element's <code>opacity</code> value. This must be a value between <code>0</code> and <code>1</code>.</p></li> </ul> <p><strong>Be aware than animating an Element which is being used by an Ext Component without in some way informing the Component about the changed element state will result in incorrect Component behaviour. This is because the Component will be using the old state of the element. To avoid this problem, it is now possible to directly animate certain properties of Components.</strong></p> <h3>Animating a <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a></h3> <p>When animating a Component, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The Component's page X position in pixels.</p></li> <li><p><code>y</code> - The Component's page Y position in pixels</p></li> <li><p><code>left</code> - The Component's <code>left</code> value in pixels.</p></li> <li><p><code>top</code> - The Component's <code>top</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>dynamic</code> - Specify as true to update the Component's layout (if it is a Container) at every frame of the animation. <em>Use sparingly as laying out on every intermediate size change is an expensive operation.</em></p></li> </ul> <p>For example, to animate a Window to a new size, ensuring that its internal layout, and any shadow is correct:</p> <pre><code>myWindow = <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>', { title: 'Test Component animation', width: 500, height: 300, layout: { type: 'hbox', align: 'stretch' }, items: [{ title: 'Left: 33%', margins: '5 0 5 5', flex: 1 }, { title: 'Left: 66%', margins: '5 5 5 5', flex: 2 }] }); myWindow.show(); myWindow.header.el.on('click', function() { myWindow.animate({ to: { width: (myWindow.getWidth() == 500) ? 700 : 500, height: (myWindow.getHeight() == 300) ? 400 : 300, } }); }); </code></pre> <p>For performance reasons, by default, the internal layout is only updated when the Window reaches its final <code>"to"</code> size. If dynamic updating of the Window's child Components is required, then configure the animation with <code>dynamic: true</code> and the two child items will maintain their proportions during the animation.</p> <p>Applies the state to the object. This should be overridden in subclasses to do more complex state operations. By default it applies the state properties onto the current object.</p> <p>Utility wrapper that suspends layouts of all components for the duration of a given function.</p> <p>Occurs before componentLayout is run. Returning false from this method will prevent the componentLayout from being executed.</p> <p>Bubbles up the component/container heirarchy, calling the specified function with each component. The scope (<em>this</em>) of function call will be the scope provided or the current component. The arguments to the function will be the args provided or the current component. If the function returns false at any point, the bubble is stopped.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Center this Component in its container.</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Clone the current component using the original config values passed into this instance by default.</p> <p>Ensures that the plugins array contains fully constructed plugin instances. This converts any configs into their appropriate instances.</p> <p>Destroys the Component.</p> <p>Disable the component.</p> <p>Handles autoRender. Floating Components may have an ownerCt. If they are asking to be constrained, constrain them within that ownerCt, and have their z-index managed locally. Floating Components are always rendered to document.body</p> <p>This method needs to be called whenever you change something on this component that requires the Component's layout to be recalculated.</p> <p>Moves this floating Component into a constrain region.</p> <p>By default, this Component is constrained to be within the container it was added to, or the element it was rendered to.</p> <p>An alternative constraint may be passed.</p> <p>Enable the component</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Ensures that this component is attached to <code>document.body</code>. If the component was rendered to Ext.getDetachedBody, then it will be appended to <code>document.body</code>. Any configured position is also restored.</p> <p>Find a container above this component at any level by a custom function. If the passed function returns true, the container will be returned.</p> <p>Find a container above this component at any level by xtype or class</p> <p>See also the <a href="#!/api/Ext.Component-method-up" rel="Ext.Component-method-up" class="docClass">up</a> method.</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Try to focus this component.</p> <p>Forces this component to redo its componentLayout.</p> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Gets the current box measurements of the component's underlying element.</p> <p>Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy.</p> <p>Retrieves the top level element representing this component.</p> <p>Gets the current height of the component's underlying element.</p> <p>Retrieves the id of this component. Will autogenerate an id if one has not already been set.</p> <p>This function takes the position argument passed to onRender and returns a DOM element that you can use in the insertBefore.</p> <p>Gets the <a href="#!/api/Ext.ComponentLoader" rel="Ext.ComponentLoader" class="docClass">Ext.ComponentLoader</a> for this Component.</p> <p>Retrieves a plugin by its pluginId which has been bound to this component.</p> <p>Gets the current XY position of the component's underlying element.</p> <p>Gets the current size of the component's underlying element.</p> <p>Returns an object that describes how this component's width and height is managed. These objects are shared and should not be modified.</p> <p>The supplied default state gathering method for the AbstractComponent class.</p> <p>This method returns dimension settings such as <code>flex</code>, <code>anchor</code>, <code>width</code> and <code>height</code> along with <code>collapsed</code> state.</p> <p>Subclasses which implement more complex state should call the superclass's implementation, and apply their state to the result if this basic state is to be saved.</p> <p>Note that Component state will only be saved if the Component has a <a href="#!/api/Ext.AbstractComponent-cfg-stateId" rel="Ext.AbstractComponent-cfg-stateId" class="docClass">stateId</a> and there as a StateProvider configured for the document.</p> <p>Gets the state id for this object.</p> <p>Gets the current width of the component's underlying element.</p> <p>Gets the xtype for this component as registered with <a href="#!/api/Ext.ComponentManager" rel="Ext.ComponentManager" class="docClass">Ext.ComponentManager</a>. For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header. Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); alert(t.getXType()); // alerts 'textfield' </code></pre> <p>Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); alert(t.getXTypes()); // alerts 'component/field/textfield' </code></pre> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Checks if the specified CSS class exists on this element's DOM node.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Checks if there is currently a specified uiCls</p> <p>Hides this Component, setting it to invisible using the configured <a href="#!/api/Ext.Component-cfg-hideMode" rel="Ext.Component-cfg-hideMode" class="docClass">hideMode</a>.</p> <p>The initComponent template method is an important initialization step for a Component. It is intended to be implemented by each subclass of <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> to provide any needed constructor logic. The initComponent method of the class being created is called first, with each initComponent method up the hierarchy to <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> being called thereafter. This makes it easy to implement and, if needed, override the constructor logic of the Component at any step in the hierarchy.</p> <p>The initComponent method <strong>must</strong> contain a call to <a href="#!/api/Ext.Base-method-callParent" rel="Ext.Base-method-callParent" class="docClass">callParent</a> in order to ensure that the parent class' initComponent method is also called.</p> <p>All config options passed to the constructor are applied to <code>this</code> before initComponent is called, so you can simply access them with <code>this.someOption</code>.</p> <p>The following example demonstrates using a dynamic string for the text of a button at the time of instantiation of the class.</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('DynamicButtonText', { extend: '<a href="#!/api/Ext.button.Button" rel="Ext.button.Button" class="docClass">Ext.button.Button</a>', initComponent: function() { this.text = new Date(); this.renderTo = <a href="#!/api/Ext-method-getBody" rel="Ext-method-getBody" class="docClass">Ext.getBody</a>(); this.callParent(); } }); <a href="#!/api/Ext-method-onReady" rel="Ext-method-onReady" class="docClass">Ext.onReady</a>(function() { <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('DynamicButtonText'); }); </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Tests whether this Component matches the selector string.</p> <p>Determines whether this component is the descendant of a particular container.</p> <p>Method to determine whether this Component is currently disabled.</p> <p>Method to determine whether this Component is draggable.</p> <p>Method to determine whether this Component is droppable.</p> <p>Method to determine whether this Component is floating.</p> <p>Method to determine whether this Component is currently set to hidden.</p> <p>Determines whether this Component is the root of a layout. This returns <code>true</code> if this component can run its layout without assistance from or impact on its owner. If this component cannot run its layout given these restrictions, <code>false</code> is returned and its owner will be considered as the next candidate for the layout root.</p> <p>Setting the <a href="#!/api/Ext.AbstractComponent-property-_isLayoutRoot" rel="Ext.AbstractComponent-property-_isLayoutRoot" class="docClass">_isLayoutRoot</a> property to <code>true</code> causes this method to always return <code>true</code>. This may be useful when updating a layout of a Container which shrink wraps content, and you know that it will not change size, and so can safely be the topmost participant in the layout run.</p> <p>Returns true if layout is suspended for this component. This can come from direct suspension of this component's layout activity (suspendLayouts) or if one of this component's containers is suspended.</p> <p>Returns true if this component is visible.</p> <p>Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended from the xtype (default) or whether it is directly of the xtype specified (shallow = true).</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); var isText = t.isXType('textfield'); // true var isBoxSubclass = t.isXType('field'); // true, descended from <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> var isBoxInstance = t.isXType('field', true); // false, not a direct <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> instance </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Returns the next node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextSibling" rel="Ext.AbstractComponent-method-nextSibling" class="docClass">nextSibling</a>.</p> <p>Returns the next sibling of this Component.</p> <p>Optionally selects the next sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>next()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextNode" rel="Ext.AbstractComponent-method-nextNode" class="docClass">nextNode</a></p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Template method called when this Component's DOM structure is created.</p> <p>At this point, this Component's (And all descendants') DOM structure <i>exists</i> but it has not been layed out (positioned and sized).</p> <p>Subclasses which override this to gain access to the structure at render time should call the parent class's method before attempting to access any child elements of the Component.</p> <p>Returns the previous node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree in reverse order to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousSibling" rel="Ext.AbstractComponent-method-previousSibling" class="docClass">previousSibling</a>.</p> <p>Returns the previous sibling of this Component.</p> <p>Optionally selects the previous sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>prev()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousNode" rel="Ext.AbstractComponent-method-previousNode" class="docClass">previousNode</a></p> <p>Called by Component#doAutoRender</p> <p>Register a Container configured <code>floating: true</code> with this Component's <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a>.</p> <p>Components added in ths way will not participate in any layout, but will be rendered upon first show in the way that <a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Window</a>s are.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes items in the childEls array based on the return value of a supplied test function. The function is called with a entry in childEls and if the test function return true, that entry is removed. If false, that entry is kept.</p> <p>Removes a CSS class from the top level element representing this component.</p> <p>Removes a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-removeUIClsFromElement" rel="Ext.AbstractComponent-method-removeUIClsFromElement" class="docClass">removeUIClsFromElement</a> and removes it from all elements of this component.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Method which removes a specified UI + uiCls from the components element. The cls which is added to the element will be: <code>this.baseCls + '-' + ui</code></p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Conditionally saves a single property from this object to the given state object. The idea is to only save state which has changed from the initial state so that current software settings do not override future software settings. Only those values that are user-changed state should be saved.</p> <p>Scrolls this Component's target element by the passed delta values, optionally animating.</p> <p>All of the following are equivalent:</p> <pre><code> comp.scrollBy(10, 10, true); comp.scrollBy([10, 10], true); comp.scrollBy({ x: 10, y: 10 }, true); </code></pre> <p>Ensures that all effects queued after sequenceFx is called on this object are run in sequence. This is the opposite of <a href="#!/api/Ext.util.Animate-method-syncFx" rel="Ext.util.Animate-method-syncFx" class="docClass">syncFx</a>.</p> <p>This method is called internally by <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">Ext.ZIndexManager</a> to signal that a floating Component has either been moved to the top of its zIndex stack, or pushed from the top of its zIndex stack.</p> <p>If a <em>Window</em> is superceded by another Window, deactivating it hides its shadow.</p> <p>This method also fires the <a href="#!/api/Ext.Component-event-activate" rel="Ext.Component-event-activate" class="docClass">activate</a> or <a href="#!/api/Ext.Component-event-deactivate" rel="Ext.Component-event-deactivate" class="docClass">deactivate</a> event depending on which action occurred.</p> <p>Sets the overflow on the content element of the component.</p> <p>Enable or disable the component.</p> <p>Sets the dock position of this component in its parent panel. Note that this only has effect if this item is part of the dockedItems collection of a parent that has a DockLayout (note that any Panel has a DockLayout by default)</p> <p>Sets the height of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>This method allows you to show or hide a LoadMask on top of this component.</p> <p>Sets the overflow x/y on the content element of the component. The x/y overflow values can be any valid CSS overflow (e.g., 'auto' or 'scroll'). By default, the value is 'hidden'. Passing null for one of the values will erase the inline style. Passing <code>undefined</code> will preserve the current value.</p> <p>Sets the page XY position of the component. To set the left and top instead, use <a href="#!/api/Ext.Component-method-setPosition" rel="Ext.Component-method-setPosition" class="docClass">setPosition</a>. This method fires the <a href="#!/api/Ext.Component-event-move" rel="Ext.Component-event-move" class="docClass">move</a> event.</p> <p>Sets the left and top of the component. To set the page XY position instead, use setPagePosition. This method fires the <a href="#!/api/Ext.AbstractComponent-event-move" rel="Ext.AbstractComponent-event-move" class="docClass">move</a> event.</p> <p>Sets the width and height of this Component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event. This method can accept either width and height as separate arguments, or you can pass a size object like <code>{width:10, height:20}</code>.</p> <p>Sets the UI for the component. This will remove any existing UIs on the component. It will also loop through any uiCls set on the component and rename them so they include the new UI</p> <p>Convenience function to hide or show this component by boolean.</p> <p>Sets the width of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>Shows this Component, rendering it first if <a href="#!/api/Ext.Component-cfg-autoRender" rel="Ext.Component-cfg-autoRender" class="docClass">autoRender</a> or <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> are <code>true</code>.</p> <p>After being shown, a <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Component (such as a <a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>), is activated it and brought to the front of its <a href="#!/api/Ext.Component-property-zIndexManager" rel="Ext.Component-property-zIndexManager" class="docClass">z-index stack</a>.</p> <p>Displays component at specific xy position. A floating component (like a menu) is positioned relative to its ownerCt if any. Useful for popping up a context menu:</p> <pre><code>listeners: { itemcontextmenu: function(view, record, item, index, event, options) { <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.menu.Menu" rel="Ext.menu.Menu" class="docClass">Ext.menu.Menu</a>', { width: 100, height: 100, margin: '0 0 10 0', items: [{ text: 'regular item 1' },{ text: 'regular item 2' },{ text: 'regular item 3' }] }).showAt(event.getXY()); } } </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Ensures that all effects queued after syncFx is called on this object are run concurrently. This is the opposite of <a href="#!/api/Ext.util.Animate-method-sequenceFx" rel="Ext.util.Animate-method-sequenceFx" class="docClass">sequenceFx</a>.</p> <p>Sends this Component to the back of (lower z-index than) any other visible windows</p> <p>Brings this floating Component to the front of any other visible, floating Components managed by the same <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a></p> <p>If this Component is modal, inserts the modal mask just below this Component in the z-index stack.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Walks up the <code>ownerCt</code> axis looking for an ancestor Container which matches the passed simple selector.</p> <p>Example:</p> <pre><code>var owningTabPanel = grid.up('tabpanel'); </code></pre> <p>Update the content area of a component.</p> <p>Sets the current box measurements of the component's underlying element.</p> <p>Updates this component's layout. If this update effects this components <a href="#!/api/Ext.AbstractComponent-property-ownerCt" rel="Ext.AbstractComponent-property-ownerCt" class="docClass">ownerCt</a>, that component's <code>updateLayout</code> method will be called to perform the layout instead. Otherwise, just this component (and its child items) will layout.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Aborts the active load request</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Destroys the loader. Any active requests will be aborted.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Returns the target of this loader.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Checks whether the loader is automatically refreshing. See <a href="#!/api/Ext.ElementLoader-method-startAutoRefresh" rel="Ext.ElementLoader-method-startAutoRefresh" class="docClass">startAutoRefresh</a>.</p> <p>Loads new data from the server.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Get the target of this loader.</p> <p>Set a {<a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a>} as the target of this loader. Note that if the target is changed, any active requests will be aborted.</p> <p>Automatically refreshes the content over a specified period.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Clears any auto refresh. See <a href="#!/api/Ext.ElementLoader-method-startAutoRefresh" rel="Ext.ElementLoader-method-startAutoRefresh" class="docClass">startAutoRefresh</a>.</p> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Contains all of the items currently managed</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Creates a new Component from the specified config object using the config object's xtype to determine the class to instantiate.</p> <p>Executes the specified function once for each item in the collection.</p> <p>Returns an item by id. For additional details see <a href="#!/api/Ext.util.HashMap-method-get" rel="Ext.util.HashMap-method-get" class="docClass">Ext.util.HashMap.get</a>.</p> <p>Gets the number of items in the collection.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Checks if an item type is registered.</p> <p>Registers a function that will be called when an item with the specified id is added to the manager. This will happen on instantiation.</p> <p>Registers an item to be managed</p> <p>Registers a new item constructor, keyed by a type key.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Unregisters an item by removing it from this manager</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Tests whether the passed Component matches the selector string.</p> <p>Returns an array of matched Components from within the passed root object.</p> <p>This method filters returned Components in a similar way to how CSS selector based DOM queries work using a textual selector string.</p> <p>See class summary for details.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Creates new Component.</p> <p>The configuration options may be specified as either:</p> <ul> <li><strong>an element</strong> : it is set as the internal element and its id used as the component id</li> <li><strong>a string</strong> : it is assumed to be the id of an existing element and is used as the component id</li> <li><strong>anything else</strong> : it is assumed to be a standard config object and is applied to the component</li> </ul> <p>Setting this property to <code>true</code> causes the <a href="#!/api/Ext.AbstractComponent-method-isLayoutRoot" rel="Ext.AbstractComponent-method-isLayoutRoot" class="docClass">isLayoutRoot</a> method to return <code>true</code> and stop the search for the top-most component for a layout.</p> <p>Indicates whether or not the component can be dragged.</p> <p>Only present for <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which were inserted as descendant items of floating Containers.</p> <p>Floating Components that are programatically <a href="#!/api/Ext.Component-event-render" rel="Ext.Component-event-render" class="docClass">rendered</a> will not have a <code>floatParent</code> property.</p> <p>For <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which are child items of a Container, the floatParent will be the floating ancestor Container which is responsible for the base z-index value of all its floating descendants. It provides a <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a> which provides z-indexing services for all its descendant floating Components.</p> <p>For example, the dropdown <a href="#!/api/Ext.view.BoundList" rel="Ext.view.BoundList" class="docClass">BoundList</a> of a ComboBox which is in a Window will have the Window as its <code>floatParent</code></p> <p>See <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> and <a href="#!/api/Ext.Component-property-zIndexManager" rel="Ext.Component-property-zIndexManager" class="docClass">zIndexManager</a></p> <p>Indicates the width of any framing elements which were added within the encapsulating element to provide graphical, rounded borders. See the <a href="#!/api/Ext.AbstractComponent-cfg-frame" rel="Ext.AbstractComponent-cfg-frame" class="docClass">frame</a> config.</p> <p>This is an object containing the frame width in pixels for all four sides of the Component containing the following properties:</p> <p>The MixedCollection containing all the child items of this container.</p> <p>This is an internal flag that you use when creating custom components. By default this is set to true which means that every component gets a mask when its disabled. Components like FieldContainer, FieldSet, Field, Button, Tab override this property to false since they want to implement custom disable logic.</p> <p>This Component's owner <a href="#!/api/Ext.container.Container" rel="Ext.container.Container" class="docClass">Container</a> (is set automatically when this Component is added to a Container).</p> <p><strong>Note</strong>: to access items within the Container see <a href="#!/api/Ext.AbstractComponent-cfg-itemId" rel="Ext.AbstractComponent-cfg-itemId" class="docClass">itemId</a>.</p> <p>Indicates whether or not the component has been rendered.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Only present for <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components after they have been rendered.</p> <p>A reference to the ZIndexManager which is managing this Component's z-index.</p> <p>The <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a> maintains a stack of floating Component z-indices, and also provides a single modal mask which is insert just beneath the topmost visible modal floating Component.</p> <p>Floating Components may be <a href="#!/api/Ext.Component-method-toFront" rel="Ext.Component-method-toFront" class="docClass">brought to the front</a> or <a href="#!/api/Ext.Component-method-toBack" rel="Ext.Component-method-toBack" class="docClass">sent to the back</a> of the z-index stack.</p> <p>This defaults to the global <a href="#!/api/Ext.WindowManager" rel="Ext.WindowManager" class="docClass">ZIndexManager</a> for floating Components that are programatically <a href="#!/api/Ext.Component-event-render" rel="Ext.Component-event-render" class="docClass">rendered</a>.</p> <p>For <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which are added to a Container, the ZIndexManager is acquired from the first ancestor Container found which is floating, or if not found the global <a href="#!/api/Ext.WindowManager" rel="Ext.WindowManager" class="docClass">ZIndexManager</a> is used.</p> <p>See <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> and <a href="#!/api/Ext.Component-property-floatParent" rel="Ext.Component-property-floatParent" class="docClass">floatParent</a></p> <p>Adds <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a>(s) to this Container.</p> <h2>Description:</h2> <ul> <li>Fires the <a href="#!/api/Ext.container.AbstractContainer-event-beforeadd" rel="Ext.container.AbstractContainer-event-beforeadd" class="docClass">beforeadd</a> event before adding.</li> <li>The Container's <a href="#!/api/Ext.container.AbstractContainer-cfg-defaults" rel="Ext.container.AbstractContainer-cfg-defaults" class="docClass">default config values</a> will be applied accordingly (see <code><a href="#!/api/Ext.container.AbstractContainer-cfg-defaults" rel="Ext.container.AbstractContainer-cfg-defaults" class="docClass">defaults</a></code> for details).</li> <li>Fires the <code><a href="#!/api/Ext.container.AbstractContainer-event-add" rel="Ext.container.AbstractContainer-event-add" class="docClass">add</a></code> event after the component has been added.</li> </ul> <h2>Notes:</h2> <p>If the Container is <strong>already rendered</strong> when <code>add</code> is called, it will render the newly added Component into its content area.</p> <p><strong>If</strong> the Container was configured with a size-managing <a href="#!/api/Ext.container.AbstractContainer-cfg-layout" rel="Ext.container.AbstractContainer-cfg-layout" class="docClass">layout</a> manager, the Container will recalculate its internal layout at this time too.</p> <p>Note that the default layout manager simply renders child Components sequentially into the content area and thereafter performs no sizing.</p> <p>If adding multiple new child Components, pass them as an array to the <code>add</code> method, so that only one layout recalculation is performed.</p> <pre><code>tb = new <a href="#!/api/Ext.toolbar.Toolbar" rel="Ext.toolbar.Toolbar" class="docClass">Ext.toolbar.Toolbar</a>({ renderTo: document.body }); // toolbar is rendered // add multiple items. // (<a href="#!/api/Ext.container.AbstractContainer-cfg-defaultType" rel="Ext.container.AbstractContainer-cfg-defaultType" class="docClass">defaultType</a> for <a href="#!/api/Ext.toolbar.Toolbar" rel="Ext.toolbar.Toolbar" class="docClass">Toolbar</a> is 'button') tb.add([{text:'Button 1'}, {text:'Button 2'}]); </code></pre> <p>To inject components between existing ones, use the <a href="#!/api/Ext.container.AbstractContainer-method-insert" rel="Ext.container.AbstractContainer-method-insert" class="docClass">insert</a> method.</p> <h2>Warning:</h2> <p>Components directly managed by the BorderLayout layout manager may not be removed or added. See the Notes for <a href="#!/api/Ext.layout.container.Border" rel="Ext.layout.container.Border" class="docClass">BorderLayout</a> for more details.</p> <p>Adds each argument passed to this method to the childEls array.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-addUIClsToElement" rel="Ext.AbstractComponent-method-addUIClsToElement" class="docClass">addUIClsToElement</a> and adds to all elements of this component.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Save a property to the given state object if it is not its default or configured value.</p> <p>Add events that will trigger the state to be saved. If the first argument is an array, each element of that array is the name of a state event. Otherwise, each argument passed to this method is the name of a state event.</p> <p>Method which adds a specified UI + uiCls to the components element. Can be overridden to remove the UI from more than just the components element.</p> <p>Called by the layout system when the Component has been layed out.</p> <p>Aligns this floating Component to the specified element</p> <p>Perform custom animation on this object.</p> <p>This method is applicable to both the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a> class and the <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a> class. It performs animated transitions of certain properties of this object over a specified timeline.</p> <p>The sole parameter is an object which specifies start property values, end property values, and properties which describe the timeline.</p> <h3>Animating an <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a></h3> <p>When animating an Element, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The page X position in pixels.</p></li> <li><p><code>y</code> - The page Y position in pixels</p></li> <li><p><code>left</code> - The element's CSS <code>left</code> value. Units must be supplied.</p></li> <li><p><code>top</code> - The element's CSS <code>top</code> value. Units must be supplied.</p></li> <li><p><code>width</code> - The element's CSS <code>width</code> value. Units must be supplied.</p></li> <li><p><code>height</code> - The element's CSS <code>height</code> value. Units must be supplied.</p></li> <li><p><code>scrollLeft</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>scrollTop</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>opacity</code> - The element's <code>opacity</code> value. This must be a value between <code>0</code> and <code>1</code>.</p></li> </ul> <p><strong>Be aware than animating an Element which is being used by an Ext Component without in some way informing the Component about the changed element state will result in incorrect Component behaviour. This is because the Component will be using the old state of the element. To avoid this problem, it is now possible to directly animate certain properties of Components.</strong></p> <h3>Animating a <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a></h3> <p>When animating a Component, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The Component's page X position in pixels.</p></li> <li><p><code>y</code> - The Component's page Y position in pixels</p></li> <li><p><code>left</code> - The Component's <code>left</code> value in pixels.</p></li> <li><p><code>top</code> - The Component's <code>top</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>dynamic</code> - Specify as true to update the Component's layout (if it is a Container) at every frame of the animation. <em>Use sparingly as laying out on every intermediate size change is an expensive operation.</em></p></li> </ul> <p>For example, to animate a Window to a new size, ensuring that its internal layout, and any shadow is correct:</p> <pre><code>myWindow = <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>', { title: 'Test Component animation', width: 500, height: 300, layout: { type: 'hbox', align: 'stretch' }, items: [{ title: 'Left: 33%', margins: '5 0 5 5', flex: 1 }, { title: 'Left: 66%', margins: '5 5 5 5', flex: 2 }] }); myWindow.show(); myWindow.header.el.on('click', function() { myWindow.animate({ to: { width: (myWindow.getWidth() == 500) ? 700 : 500, height: (myWindow.getHeight() == 300) ? 400 : 300, } }); }); </code></pre> <p>For performance reasons, by default, the internal layout is only updated when the Window reaches its final <code>"to"</code> size. If dynamic updating of the Window's child Components is required, then configure the animation with <code>dynamic: true</code> and the two child items will maintain their proportions during the animation.</p> <p>Applies the state to the object. This should be overridden in subclasses to do more complex state operations. By default it applies the state properties onto the current object.</p> <p>Utility wrapper that suspends layouts of all components for the duration of a given function.</p> <p>Occurs before componentLayout is run. Returning false from this method will prevent the componentLayout from being executed.</p> <p>Occurs before componentLayout is run. Returning false from this method will prevent the containerLayout from being executed.</p> <p>Bubbles up the component/container heirarchy, calling the specified function with each component. The scope (<em>this</em>) of function call will be the scope provided or the current component. The arguments to the function will be the args provided or the current component. If the function returns false at any point, the bubble is stopped.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Cascades down the component/container heirarchy from this component (passed in the first call), calling the specified function with each component. The scope (this reference) of the function call will be the scope provided or the current component. The arguments to the function will be the args provided or the current component. If the function returns false at any point, the cascade is stopped on that branch.</p> <p>Center this Component in its container.</p> <p>Retrieves the first direct child of this container which matches the passed selector. The passed in selector must comply with an <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">Ext.ComponentQuery</a> selector.</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Clone the current component using the original config values passed into this instance by default.</p> <p>Ensures that the plugins array contains fully constructed plugin instances. This converts any configs into their appropriate instances.</p> <p>Destroys the Component.</p> <p>Disable the component.</p> <p>Handles autoRender. Floating Components may have an ownerCt. If they are asking to be constrained, constrain them within that ownerCt, and have their z-index managed locally. Floating Components are always rendered to document.body</p> <p>This method needs to be called whenever you change something on this component that requires the Component's layout to be recalculated.</p> <p>Moves this floating Component into a constrain region.</p> <p>By default, this Component is constrained to be within the container it was added to, or the element it was rendered to.</p> <p>An alternative constraint may be passed.</p> <p>Manually force this container's layout to be recalculated. The framework uses this internally to refresh layouts form most cases.</p> <p>Retrieves the first descendant of this container which matches the passed selector. The passed in selector must comply with an <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">Ext.ComponentQuery</a> selector.</p> <p>Enable the component</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Ensures that this component is attached to <code>document.body</code>. If the component was rendered to Ext.getDetachedBody, then it will be appended to <code>document.body</code>. Any configured position is also restored.</p> <p>Find a container above this component at any level by a custom function. If the passed function returns true, the container will be returned.</p> <p>Find a container above this component at any level by xtype or class</p> <p>See also the <a href="#!/api/Ext.Component-method-up" rel="Ext.Component-method-up" class="docClass">up</a> method.</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Try to focus this component.</p> <p>Forces this component to redo its componentLayout.</p> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Gets the current box measurements of the component's underlying element.</p> <p>Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy.</p> <p>Examines this container's <a href="#!/api/Ext.container.AbstractContainer-property-items" rel="Ext.container.AbstractContainer-property-items" class="docClass">items</a> <strong>property</strong> and gets a direct child component of this container.</p> <p>Retrieves the top level element representing this component.</p> <p>Gets the current height of the component's underlying element.</p> <p>Retrieves the id of this component. Will autogenerate an id if one has not already been set.</p> <p>This function takes the position argument passed to onRender and returns a DOM element that you can use in the insertBefore.</p> <p>Returns the <a href="#!/api/Ext.layout.container.Container" rel="Ext.layout.container.Container" class="docClass">layout</a> instance currently associated with this Container. If a layout has not been instantiated yet, that is done first</p> <p>Gets the <a href="#!/api/Ext.ComponentLoader" rel="Ext.ComponentLoader" class="docClass">Ext.ComponentLoader</a> for this Component.</p> <p>Retrieves a plugin by its pluginId which has been bound to this component.</p> <p>Gets the current XY position of the component's underlying element.</p> <p>Gets the current size of the component's underlying element.</p> <p>Returns an object that describes how this component's width and height is managed. These objects are shared and should not be modified.</p> <p>The supplied default state gathering method for the AbstractComponent class.</p> <p>This method returns dimension settings such as <code>flex</code>, <code>anchor</code>, <code>width</code> and <code>height</code> along with <code>collapsed</code> state.</p> <p>Subclasses which implement more complex state should call the superclass's implementation, and apply their state to the result if this basic state is to be saved.</p> <p>Note that Component state will only be saved if the Component has a <a href="#!/api/Ext.AbstractComponent-cfg-stateId" rel="Ext.AbstractComponent-cfg-stateId" class="docClass">stateId</a> and there as a StateProvider configured for the document.</p> <p>Gets the state id for this object.</p> <p>Gets the current width of the component's underlying element.</p> <p>Gets the xtype for this component as registered with <a href="#!/api/Ext.ComponentManager" rel="Ext.ComponentManager" class="docClass">Ext.ComponentManager</a>. For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header. Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); alert(t.getXType()); // alerts 'textfield' </code></pre> <p>Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); alert(t.getXTypes()); // alerts 'component/field/textfield' </code></pre> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Checks if the specified CSS class exists on this element's DOM node.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Checks if there is currently a specified uiCls</p> <p>Hides this Component, setting it to invisible using the configured <a href="#!/api/Ext.Component-cfg-hideMode" rel="Ext.Component-cfg-hideMode" class="docClass">hideMode</a>.</p> <p>The initComponent template method is an important initialization step for a Component. It is intended to be implemented by each subclass of <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> to provide any needed constructor logic. The initComponent method of the class being created is called first, with each initComponent method up the hierarchy to <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> being called thereafter. This makes it easy to implement and, if needed, override the constructor logic of the Component at any step in the hierarchy.</p> <p>The initComponent method <strong>must</strong> contain a call to <a href="#!/api/Ext.Base-method-callParent" rel="Ext.Base-method-callParent" class="docClass">callParent</a> in order to ensure that the parent class' initComponent method is also called.</p> <p>All config options passed to the constructor are applied to <code>this</code> before initComponent is called, so you can simply access them with <code>this.someOption</code>.</p> <p>The following example demonstrates using a dynamic string for the text of a button at the time of instantiation of the class.</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('DynamicButtonText', { extend: '<a href="#!/api/Ext.button.Button" rel="Ext.button.Button" class="docClass">Ext.button.Button</a>', initComponent: function() { this.text = new Date(); this.renderTo = <a href="#!/api/Ext-method-getBody" rel="Ext-method-getBody" class="docClass">Ext.getBody</a>(); this.callParent(); } }); <a href="#!/api/Ext-method-onReady" rel="Ext-method-onReady" class="docClass">Ext.onReady</a>(function() { <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('DynamicButtonText'); }); </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Inserts a Component into this Container at a specified index. Fires the <a href="#!/api/Ext.container.AbstractContainer-event-beforeadd" rel="Ext.container.AbstractContainer-event-beforeadd" class="docClass">beforeadd</a> event before inserting, then fires the <a href="#!/api/Ext.container.AbstractContainer-event-add" rel="Ext.container.AbstractContainer-event-add" class="docClass">add</a> event after the Component has been inserted.</p> <p>Tests whether this Component matches the selector string.</p> <p>Determines whether <strong>this Container</strong> is an ancestor of the passed Component. This will return <code>true</code> if the passed Component is anywhere within the subtree beneath this Container.</p> <p>Determines whether this component is the descendant of a particular container.</p> <p>Method to determine whether this Component is currently disabled.</p> <p>Method to determine whether this Component is draggable.</p> <p>Method to determine whether this Component is droppable.</p> <p>Method to determine whether this Component is floating.</p> <p>Method to determine whether this Component is currently set to hidden.</p> <p>Determines whether this Component is the root of a layout. This returns <code>true</code> if this component can run its layout without assistance from or impact on its owner. If this component cannot run its layout given these restrictions, <code>false</code> is returned and its owner will be considered as the next candidate for the layout root.</p> <p>Setting the <a href="#!/api/Ext.AbstractComponent-property-_isLayoutRoot" rel="Ext.AbstractComponent-property-_isLayoutRoot" class="docClass">_isLayoutRoot</a> property to <code>true</code> causes this method to always return <code>true</code>. This may be useful when updating a layout of a Container which shrink wraps content, and you know that it will not change size, and so can safely be the topmost participant in the layout run.</p> <p>Returns true if layout is suspended for this component. This can come from direct suspension of this component's layout activity (suspendLayouts) or if one of this component's containers is suspended.</p> <p>Returns true if this component is visible.</p> <p>Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended from the xtype (default) or whether it is directly of the xtype specified (shallow = true).</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); var isText = t.isXType('textfield'); // true var isBoxSubclass = t.isXType('field'); // true, descended from <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> var isBoxInstance = t.isXType('field', true); // false, not a direct <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> instance </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Moves a Component within the Container</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Returns the next node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextSibling" rel="Ext.AbstractComponent-method-nextSibling" class="docClass">nextSibling</a>.</p> <p>Returns the next sibling of this Component.</p> <p>Optionally selects the next sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>next()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextNode" rel="Ext.AbstractComponent-method-nextNode" class="docClass">nextNode</a></p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Template method called when this Component's DOM structure is created.</p> <p>At this point, this Component's (And all descendants') DOM structure <i>exists</i> but it has not been layed out (positioned and sized).</p> <p>Subclasses which override this to gain access to the structure at render time should call the parent class's method before attempting to access any child elements of the Component.</p> <p>Returns the previous node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree in reverse order to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousSibling" rel="Ext.AbstractComponent-method-previousSibling" class="docClass">previousSibling</a>.</p> <p>Returns the previous sibling of this Component.</p> <p>Optionally selects the previous sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>prev()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousNode" rel="Ext.AbstractComponent-method-previousNode" class="docClass">previousNode</a></p> <p>Retrieves all descendant components which match the passed selector. Executes an <a href="#!/api/Ext.ComponentQuery-method-query" rel="Ext.ComponentQuery-method-query" class="docClass">Ext.ComponentQuery.query</a> using this container as its root.</p> <p>Retrieves all descendant components which match the passed function. The function should return false for components that are to be excluded from the selection.</p> <p>Finds a component at any level under this container matching the id/itemId. This is a shorthand for calling ct.down('#' + id);</p> <p>Called by Component#doAutoRender</p> <p>Register a Container configured <code>floating: true</code> with this Component's <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a>.</p> <p>Components added in ths way will not participate in any layout, but will be rendered upon first show in the way that <a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Window</a>s are.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes a component from this container. Fires the <a href="#!/api/Ext.container.AbstractContainer-event-beforeremove" rel="Ext.container.AbstractContainer-event-beforeremove" class="docClass">beforeremove</a> event before removing, then fires the <a href="#!/api/Ext.container.AbstractContainer-event-remove" rel="Ext.container.AbstractContainer-event-remove" class="docClass">remove</a> event after the component has been removed.</p> <p>Removes all components from this container.</p> <p>Removes items in the childEls array based on the return value of a supplied test function. The function is called with a entry in childEls and if the test function return true, that entry is removed. If false, that entry is kept.</p> <p>Removes a CSS class from the top level element representing this component.</p> <p>Removes a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-removeUIClsFromElement" rel="Ext.AbstractComponent-method-removeUIClsFromElement" class="docClass">removeUIClsFromElement</a> and removes it from all elements of this component.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Method which removes a specified UI + uiCls from the components element. The cls which is added to the element will be: <code>this.baseCls + '-' + ui</code></p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Conditionally saves a single property from this object to the given state object. The idea is to only save state which has changed from the initial state so that current software settings do not override future software settings. Only those values that are user-changed state should be saved.</p> <p>Scrolls this Component's target element by the passed delta values, optionally animating.</p> <p>All of the following are equivalent:</p> <pre><code> comp.scrollBy(10, 10, true); comp.scrollBy([10, 10], true); comp.scrollBy({ x: 10, y: 10 }, true); </code></pre> <p>Ensures that all effects queued after sequenceFx is called on this object are run in sequence. This is the opposite of <a href="#!/api/Ext.util.Animate-method-syncFx" rel="Ext.util.Animate-method-syncFx" class="docClass">syncFx</a>.</p> <p>This method is called internally by <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">Ext.ZIndexManager</a> to signal that a floating Component has either been moved to the top of its zIndex stack, or pushed from the top of its zIndex stack.</p> <p>If a <em>Window</em> is superceded by another Window, deactivating it hides its shadow.</p> <p>This method also fires the <a href="#!/api/Ext.Component-event-activate" rel="Ext.Component-event-activate" class="docClass">activate</a> or <a href="#!/api/Ext.Component-event-deactivate" rel="Ext.Component-event-deactivate" class="docClass">deactivate</a> event depending on which action occurred.</p> <p>Sets the overflow on the content element of the component.</p> <p>Enable or disable the component.</p> <p>Sets the dock position of this component in its parent panel. Note that this only has effect if this item is part of the dockedItems collection of a parent that has a DockLayout (note that any Panel has a DockLayout by default)</p> <p>Sets the height of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>This method allows you to show or hide a LoadMask on top of this component.</p> <p>Sets the overflow x/y on the content element of the component. The x/y overflow values can be any valid CSS overflow (e.g., 'auto' or 'scroll'). By default, the value is 'hidden'. Passing null for one of the values will erase the inline style. Passing <code>undefined</code> will preserve the current value.</p> <p>Sets the page XY position of the component. To set the left and top instead, use <a href="#!/api/Ext.Component-method-setPosition" rel="Ext.Component-method-setPosition" class="docClass">setPosition</a>. This method fires the <a href="#!/api/Ext.Component-event-move" rel="Ext.Component-event-move" class="docClass">move</a> event.</p> <p>Sets the left and top of the component. To set the page XY position instead, use setPagePosition. This method fires the <a href="#!/api/Ext.AbstractComponent-event-move" rel="Ext.AbstractComponent-event-move" class="docClass">move</a> event.</p> <p>Sets the width and height of this Component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event. This method can accept either width and height as separate arguments, or you can pass a size object like <code>{width:10, height:20}</code>.</p> <p>Sets the UI for the component. This will remove any existing UIs on the component. It will also loop through any uiCls set on the component and rename them so they include the new UI</p> <p>Convenience function to hide or show this component by boolean.</p> <p>Sets the width of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>Shows this Component, rendering it first if <a href="#!/api/Ext.Component-cfg-autoRender" rel="Ext.Component-cfg-autoRender" class="docClass">autoRender</a> or <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> are <code>true</code>.</p> <p>After being shown, a <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Component (such as a <a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>), is activated it and brought to the front of its <a href="#!/api/Ext.Component-property-zIndexManager" rel="Ext.Component-property-zIndexManager" class="docClass">z-index stack</a>.</p> <p>Displays component at specific xy position. A floating component (like a menu) is positioned relative to its ownerCt if any. Useful for popping up a context menu:</p> <pre><code>listeners: { itemcontextmenu: function(view, record, item, index, event, options) { <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.menu.Menu" rel="Ext.menu.Menu" class="docClass">Ext.menu.Menu</a>', { width: 100, height: 100, margin: '0 0 10 0', items: [{ text: 'regular item 1' },{ text: 'regular item 2' },{ text: 'regular item 3' }] }).showAt(event.getXY()); } } </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Ensures that all effects queued after syncFx is called on this object are run concurrently. This is the opposite of <a href="#!/api/Ext.util.Animate-method-sequenceFx" rel="Ext.util.Animate-method-sequenceFx" class="docClass">sequenceFx</a>.</p> <p>Sends this Component to the back of (lower z-index than) any other visible windows</p> <p>Brings this floating Component to the front of any other visible, floating Components managed by the same <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a></p> <p>If this Component is modal, inserts the modal mask just below this Component in the z-index stack.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Walks up the <code>ownerCt</code> axis looking for an ancestor Container which matches the passed simple selector.</p> <p>Example:</p> <pre><code>var owningTabPanel = grid.up('tabpanel'); </code></pre> <p>Update the content area of a component.</p> <p>Sets the current box measurements of the component's underlying element.</p> <p>Updates this component's layout. If this update effects this components <a href="#!/api/Ext.AbstractComponent-property-ownerCt" rel="Ext.AbstractComponent-property-ownerCt" class="docClass">ownerCt</a>, that component's <code>updateLayout</code> method will be called to perform the layout instead. Otherwise, just this component (and its child items) will layout.</p> <p>Creates new Component.</p> <p>The configuration options may be specified as either:</p> <ul> <li><strong>an element</strong> : it is set as the internal element and its id used as the component id</li> <li><strong>a string</strong> : it is assumed to be the id of an existing element and is used as the component id</li> <li><strong>anything else</strong> : it is assumed to be a standard config object and is applied to the component</li> </ul> <p>Setting this property to <code>true</code> causes the <a href="#!/api/Ext.AbstractComponent-method-isLayoutRoot" rel="Ext.AbstractComponent-method-isLayoutRoot" class="docClass">isLayoutRoot</a> method to return <code>true</code> and stop the search for the top-most component for a layout.</p> <p>If this Panel is configured <a href="#!/api/Ext.panel.Panel-cfg-draggable" rel="Ext.panel.Panel-cfg-draggable" class="docClass">draggable</a>, this property will contain an instance of <a href="#!/api/Ext.dd.DragSource" rel="Ext.dd.DragSource" class="docClass">Ext.dd.DragSource</a> which handles dragging the Panel.</p> <p>The developer must provide implementations of the abstract methods of <a href="#!/api/Ext.dd.DragSource" rel="Ext.dd.DragSource" class="docClass">Ext.dd.DragSource</a> in order to supply behaviour for each stage of the drag/drop process. See <a href="#!/api/Ext.panel.Panel-cfg-draggable" rel="Ext.panel.Panel-cfg-draggable" class="docClass">draggable</a>.</p> <p>Indicates whether or not the component can be dragged.</p> <p>Only present for <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which were inserted as descendant items of floating Containers.</p> <p>Floating Components that are programatically <a href="#!/api/Ext.Component-event-render" rel="Ext.Component-event-render" class="docClass">rendered</a> will not have a <code>floatParent</code> property.</p> <p>For <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which are child items of a Container, the floatParent will be the floating ancestor Container which is responsible for the base z-index value of all its floating descendants. It provides a <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a> which provides z-indexing services for all its descendant floating Components.</p> <p>For example, the dropdown <a href="#!/api/Ext.view.BoundList" rel="Ext.view.BoundList" class="docClass">BoundList</a> of a ComboBox which is in a Window will have the Window as its <code>floatParent</code></p> <p>See <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> and <a href="#!/api/Ext.Component-property-zIndexManager" rel="Ext.Component-property-zIndexManager" class="docClass">zIndexManager</a></p> <p>Indicates the width of any framing elements which were added within the encapsulating element to provide graphical, rounded borders. See the <a href="#!/api/Ext.AbstractComponent-cfg-frame" rel="Ext.AbstractComponent-cfg-frame" class="docClass">frame</a> config.</p> <p>This is an object containing the frame width in pixels for all four sides of the Component containing the following properties:</p> <p>The MixedCollection containing all the child items of this container.</p> <p>This is an internal flag that you use when creating custom components. By default this is set to true which means that every component gets a mask when its disabled. Components like FieldContainer, FieldSet, Field, Button, Tab override this property to false since they want to implement custom disable logic.</p> <p>This Component's owner <a href="#!/api/Ext.container.Container" rel="Ext.container.Container" class="docClass">Container</a> (is set automatically when this Component is added to a Container).</p> <p><strong>Note</strong>: to access items within the Container see <a href="#!/api/Ext.AbstractComponent-cfg-itemId" rel="Ext.AbstractComponent-cfg-itemId" class="docClass">itemId</a>.</p> <p>Indicates whether or not the component has been rendered.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Only present for <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components after they have been rendered.</p> <p>A reference to the ZIndexManager which is managing this Component's z-index.</p> <p>The <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a> maintains a stack of floating Component z-indices, and also provides a single modal mask which is insert just beneath the topmost visible modal floating Component.</p> <p>Floating Components may be <a href="#!/api/Ext.Component-method-toFront" rel="Ext.Component-method-toFront" class="docClass">brought to the front</a> or <a href="#!/api/Ext.Component-method-toBack" rel="Ext.Component-method-toBack" class="docClass">sent to the back</a> of the z-index stack.</p> <p>This defaults to the global <a href="#!/api/Ext.WindowManager" rel="Ext.WindowManager" class="docClass">ZIndexManager</a> for floating Components that are programatically <a href="#!/api/Ext.Component-event-render" rel="Ext.Component-event-render" class="docClass">rendered</a>.</p> <p>For <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which are added to a Container, the ZIndexManager is acquired from the first ancestor Container found which is floating, or if not found the global <a href="#!/api/Ext.WindowManager" rel="Ext.WindowManager" class="docClass">ZIndexManager</a> is used.</p> <p>See <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> and <a href="#!/api/Ext.Component-property-floatParent" rel="Ext.Component-property-floatParent" class="docClass">floatParent</a></p> <p>Adds <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a>(s) to this Container.</p> <h2>Description:</h2> <ul> <li>Fires the <a href="#!/api/Ext.container.AbstractContainer-event-beforeadd" rel="Ext.container.AbstractContainer-event-beforeadd" class="docClass">beforeadd</a> event before adding.</li> <li>The Container's <a href="#!/api/Ext.container.AbstractContainer-cfg-defaults" rel="Ext.container.AbstractContainer-cfg-defaults" class="docClass">default config values</a> will be applied accordingly (see <code><a href="#!/api/Ext.container.AbstractContainer-cfg-defaults" rel="Ext.container.AbstractContainer-cfg-defaults" class="docClass">defaults</a></code> for details).</li> <li>Fires the <code><a href="#!/api/Ext.container.AbstractContainer-event-add" rel="Ext.container.AbstractContainer-event-add" class="docClass">add</a></code> event after the component has been added.</li> </ul> <h2>Notes:</h2> <p>If the Container is <strong>already rendered</strong> when <code>add</code> is called, it will render the newly added Component into its content area.</p> <p><strong>If</strong> the Container was configured with a size-managing <a href="#!/api/Ext.container.AbstractContainer-cfg-layout" rel="Ext.container.AbstractContainer-cfg-layout" class="docClass">layout</a> manager, the Container will recalculate its internal layout at this time too.</p> <p>Note that the default layout manager simply renders child Components sequentially into the content area and thereafter performs no sizing.</p> <p>If adding multiple new child Components, pass them as an array to the <code>add</code> method, so that only one layout recalculation is performed.</p> <pre><code>tb = new <a href="#!/api/Ext.toolbar.Toolbar" rel="Ext.toolbar.Toolbar" class="docClass">Ext.toolbar.Toolbar</a>({ renderTo: document.body }); // toolbar is rendered // add multiple items. // (<a href="#!/api/Ext.container.AbstractContainer-cfg-defaultType" rel="Ext.container.AbstractContainer-cfg-defaultType" class="docClass">defaultType</a> for <a href="#!/api/Ext.toolbar.Toolbar" rel="Ext.toolbar.Toolbar" class="docClass">Toolbar</a> is 'button') tb.add([{text:'Button 1'}, {text:'Button 2'}]); </code></pre> <p>To inject components between existing ones, use the <a href="#!/api/Ext.container.AbstractContainer-method-insert" rel="Ext.container.AbstractContainer-method-insert" class="docClass">insert</a> method.</p> <h2>Warning:</h2> <p>Components directly managed by the BorderLayout layout manager may not be removed or added. See the Notes for <a href="#!/api/Ext.layout.container.Border" rel="Ext.layout.container.Border" class="docClass">BorderLayout</a> for more details.</p> <p>Adds each argument passed to this method to the childEls array.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-addUIClsToElement" rel="Ext.AbstractComponent-method-addUIClsToElement" class="docClass">addUIClsToElement</a> and adds to all elements of this component.</p> <p>Adds docked item(s) to the container.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Save a property to the given state object if it is not its default or configured value.</p> <p>Add events that will trigger the state to be saved. If the first argument is an array, each element of that array is the name of a state event. Otherwise, each argument passed to this method is the name of a state event.</p> <p>Method which adds a specified UI + uiCls to the components element. Can be overridden to remove the UI from more than just the components element.</p> <p>Called by the layout system when the Component has been layed out.</p> <p>Aligns this floating Component to the specified element</p> <p>Perform custom animation on this object.</p> <p>This method is applicable to both the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a> class and the <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a> class. It performs animated transitions of certain properties of this object over a specified timeline.</p> <p>The sole parameter is an object which specifies start property values, end property values, and properties which describe the timeline.</p> <h3>Animating an <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a></h3> <p>When animating an Element, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The page X position in pixels.</p></li> <li><p><code>y</code> - The page Y position in pixels</p></li> <li><p><code>left</code> - The element's CSS <code>left</code> value. Units must be supplied.</p></li> <li><p><code>top</code> - The element's CSS <code>top</code> value. Units must be supplied.</p></li> <li><p><code>width</code> - The element's CSS <code>width</code> value. Units must be supplied.</p></li> <li><p><code>height</code> - The element's CSS <code>height</code> value. Units must be supplied.</p></li> <li><p><code>scrollLeft</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>scrollTop</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>opacity</code> - The element's <code>opacity</code> value. This must be a value between <code>0</code> and <code>1</code>.</p></li> </ul> <p><strong>Be aware than animating an Element which is being used by an Ext Component without in some way informing the Component about the changed element state will result in incorrect Component behaviour. This is because the Component will be using the old state of the element. To avoid this problem, it is now possible to directly animate certain properties of Components.</strong></p> <h3>Animating a <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a></h3> <p>When animating a Component, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The Component's page X position in pixels.</p></li> <li><p><code>y</code> - The Component's page Y position in pixels</p></li> <li><p><code>left</code> - The Component's <code>left</code> value in pixels.</p></li> <li><p><code>top</code> - The Component's <code>top</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>dynamic</code> - Specify as true to update the Component's layout (if it is a Container) at every frame of the animation. <em>Use sparingly as laying out on every intermediate size change is an expensive operation.</em></p></li> </ul> <p>For example, to animate a Window to a new size, ensuring that its internal layout, and any shadow is correct:</p> <pre><code>myWindow = <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>', { title: 'Test Component animation', width: 500, height: 300, layout: { type: 'hbox', align: 'stretch' }, items: [{ title: 'Left: 33%', margins: '5 0 5 5', flex: 1 }, { title: 'Left: 66%', margins: '5 5 5 5', flex: 2 }] }); myWindow.show(); myWindow.header.el.on('click', function() { myWindow.animate({ to: { width: (myWindow.getWidth() == 500) ? 700 : 500, height: (myWindow.getHeight() == 300) ? 400 : 300, } }); }); </code></pre> <p>For performance reasons, by default, the internal layout is only updated when the Window reaches its final <code>"to"</code> size. If dynamic updating of the Window's child Components is required, then configure the animation with <code>dynamic: true</code> and the two child items will maintain their proportions during the animation.</p> <p>Applies the state to the object. This should be overridden in subclasses to do more complex state operations. By default it applies the state properties onto the current object.</p> <p>Utility wrapper that suspends layouts of all components for the duration of a given function.</p> <p>Occurs before componentLayout is run. Returning false from this method will prevent the componentLayout from being executed.</p> <p>Occurs before componentLayout is run. Returning false from this method will prevent the containerLayout from being executed.</p> <p>Bubbles up the component/container heirarchy, calling the specified function with each component. The scope (<em>this</em>) of function call will be the scope provided or the current component. The arguments to the function will be the args provided or the current component. If the function returns false at any point, the bubble is stopped.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Cascades down the component/container heirarchy from this component (passed in the first call), calling the specified function with each component. The scope (this reference) of the function call will be the scope provided or the current component. The arguments to the function will be the args provided or the current component. If the function returns false at any point, the cascade is stopped on that branch.</p> <p>Center this Component in its container.</p> <p>Retrieves the first direct child of this container which matches the passed selector. The passed in selector must comply with an <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">Ext.ComponentQuery</a> selector.</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Clone the current component using the original config values passed into this instance by default.</p> <p>Closes the Panel. By default, this method, removes it from the DOM, <a href="#!/api/Ext.Component-method-destroy" rel="Ext.Component-method-destroy" class="docClass">destroy</a>s the Panel object and all its descendant Components. The <a href="#!/api/Ext.panel.Panel-event-beforeclose" rel="Ext.panel.Panel-event-beforeclose" class="docClass">beforeclose</a> event is fired before the close happens and will cancel the close action if it returns false.</p> <p><strong>Note:</strong> This method is also affected by the <a href="#!/api/Ext.panel.Panel-cfg-closeAction" rel="Ext.panel.Panel-cfg-closeAction" class="docClass">closeAction</a> setting. For more explicit control use <a href="#!/api/Ext.panel.Panel-method-destroy" rel="Ext.panel.Panel-method-destroy" class="docClass">destroy</a> and <a href="#!/api/Ext.panel.Panel-method-hide" rel="Ext.panel.Panel-method-hide" class="docClass">hide</a> methods.</p> <p>Collapses the panel body so that the body becomes hidden. Docked Components parallel to the border towards which the collapse takes place will remain visible. Fires the <a href="#!/api/Ext.panel.Panel-event-beforecollapse" rel="Ext.panel.Panel-event-beforecollapse" class="docClass">beforecollapse</a> event which will cancel the collapse action if it returns false.</p> <p>Ensures that the plugins array contains fully constructed plugin instances. This converts any configs into their appropriate instances.</p> <p>Destroys the Component.</p> <p>Disable the component.</p> <p>Handles autoRender. Floating Components may have an ownerCt. If they are asking to be constrained, constrain them within that ownerCt, and have their z-index managed locally. Floating Components are always rendered to document.body</p> <p>This method needs to be called whenever you change something on this component that requires the Component's layout to be recalculated.</p> <p>Moves this floating Component into a constrain region.</p> <p>By default, this Component is constrained to be within the container it was added to, or the element it was rendered to.</p> <p>An alternative constraint may be passed.</p> <p>Manually force this container's layout to be recalculated. The framework uses this internally to refresh layouts form most cases.</p> <p>Retrieves the first descendant of this container which matches the passed selector. The passed in selector must comply with an <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">Ext.ComponentQuery</a> selector.</p> <p>Enable the component</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Ensures that this component is attached to <code>document.body</code>. If the component was rendered to Ext.getDetachedBody, then it will be appended to <code>document.body</code>. Any configured position is also restored.</p> <p>Expands the panel body so that it becomes visible. Fires the <a href="#!/api/Ext.panel.Panel-event-beforeexpand" rel="Ext.panel.Panel-event-beforeexpand" class="docClass">beforeexpand</a> event which will cancel the expand action if it returns false.</p> <p>Find a container above this component at any level by a custom function. If the passed function returns true, the container will be returned.</p> <p>Find a container above this component at any level by xtype or class</p> <p>See also the <a href="#!/api/Ext.Component-method-up" rel="Ext.Component-method-up" class="docClass">up</a> method.</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Try to focus this component.</p> <p>Forces this component to redo its componentLayout.</p> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Gets the current box measurements of the component's underlying element.</p> <p>Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy.</p> <p>Return the immediate child Component in which the passed element is located.</p> <p>Attempts a default component lookup (see <a href="#!/api/Ext.container.Container-method-getComponent" rel="Ext.container.Container-method-getComponent" class="docClass">Ext.container.Container.getComponent</a>). If the component is not found in the normal items, the dockedItems are searched and the matched component (if any) returned (see <a href="#!/api/Ext.panel.AbstractPanel-method-getDockedComponent" rel="Ext.panel.AbstractPanel-method-getDockedComponent" class="docClass">getDockedComponent</a>). Note that docked items will only be matched by component id or itemId -- if you pass a numeric index only non-docked child components will be searched.</p> <p>Finds a docked component by id, itemId or position. Also see <a href="#!/api/Ext.container.DockingContainer-method-getDockedItems" rel="Ext.container.DockingContainer-method-getDockedItems" class="docClass">getDockedItems</a></p> <p>Retrieves an array of all currently docked Components.</p> <p>For example to find a toolbar that has been docked at top:</p> <pre><code>panel.getDockedItems('toolbar[dock="top"]'); </code></pre> <p>Retrieves the top level element representing this component.</p> <p>Gets the current height of the component's underlying element.</p> <p>Retrieves the id of this component. Will autogenerate an id if one has not already been set.</p> <p>This function takes the position argument passed to onRender and returns a DOM element that you can use in the insertBefore.</p> <p>Returns the <a href="#!/api/Ext.layout.container.Container" rel="Ext.layout.container.Container" class="docClass">layout</a> instance currently associated with this Container. If a layout has not been instantiated yet, that is done first</p> <p>Gets the <a href="#!/api/Ext.ComponentLoader" rel="Ext.ComponentLoader" class="docClass">Ext.ComponentLoader</a> for this Component.</p> <p>Retrieves a plugin by its pluginId which has been bound to this component.</p> <p>Gets the current XY position of the component's underlying element.</p> <p>Gets the current size of the component's underlying element.</p> <p>Returns an object that describes how this component's width and height is managed. These objects are shared and should not be modified.</p> <p>The supplied default state gathering method for the AbstractComponent class.</p> <p>This method returns dimension settings such as <code>flex</code>, <code>anchor</code>, <code>width</code> and <code>height</code> along with <code>collapsed</code> state.</p> <p>Subclasses which implement more complex state should call the superclass's implementation, and apply their state to the result if this basic state is to be saved.</p> <p>Note that Component state will only be saved if the Component has a <a href="#!/api/Ext.AbstractComponent-cfg-stateId" rel="Ext.AbstractComponent-cfg-stateId" class="docClass">stateId</a> and there as a StateProvider configured for the document.</p> <p>Gets the state id for this object.</p> <p>Gets the current width of the component's underlying element.</p> <p>Gets the xtype for this component as registered with <a href="#!/api/Ext.ComponentManager" rel="Ext.ComponentManager" class="docClass">Ext.ComponentManager</a>. For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header. Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); alert(t.getXType()); // alerts 'textfield' </code></pre> <p>Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); alert(t.getXTypes()); // alerts 'component/field/textfield' </code></pre> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Checks if the specified CSS class exists on this element's DOM node.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Checks if there is currently a specified uiCls</p> <p>Hides this Component, setting it to invisible using the configured <a href="#!/api/Ext.Component-cfg-hideMode" rel="Ext.Component-cfg-hideMode" class="docClass">hideMode</a>.</p> <p>The initComponent template method is an important initialization step for a Component. It is intended to be implemented by each subclass of <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> to provide any needed constructor logic. The initComponent method of the class being created is called first, with each initComponent method up the hierarchy to <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> being called thereafter. This makes it easy to implement and, if needed, override the constructor logic of the Component at any step in the hierarchy.</p> <p>The initComponent method <strong>must</strong> contain a call to <a href="#!/api/Ext.Base-method-callParent" rel="Ext.Base-method-callParent" class="docClass">callParent</a> in order to ensure that the parent class' initComponent method is also called.</p> <p>All config options passed to the constructor are applied to <code>this</code> before initComponent is called, so you can simply access them with <code>this.someOption</code>.</p> <p>The following example demonstrates using a dynamic string for the text of a button at the time of instantiation of the class.</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('DynamicButtonText', { extend: '<a href="#!/api/Ext.button.Button" rel="Ext.button.Button" class="docClass">Ext.button.Button</a>', initComponent: function() { this.text = new Date(); this.renderTo = <a href="#!/api/Ext-method-getBody" rel="Ext-method-getBody" class="docClass">Ext.getBody</a>(); this.callParent(); } }); <a href="#!/api/Ext-method-onReady" rel="Ext-method-onReady" class="docClass">Ext.onReady</a>(function() { <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('DynamicButtonText'); }); </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Inserts a Component into this Container at a specified index. Fires the <a href="#!/api/Ext.container.AbstractContainer-event-beforeadd" rel="Ext.container.AbstractContainer-event-beforeadd" class="docClass">beforeadd</a> event before inserting, then fires the <a href="#!/api/Ext.container.AbstractContainer-event-add" rel="Ext.container.AbstractContainer-event-add" class="docClass">add</a> event after the Component has been inserted.</p> <p>Inserts docked item(s) to the panel at the indicated position.</p> <p>Tests whether this Component matches the selector string.</p> <p>Determines whether <strong>this Container</strong> is an ancestor of the passed Component. This will return <code>true</code> if the passed Component is anywhere within the subtree beneath this Container.</p> <p>Determines whether this component is the descendant of a particular container.</p> <p>Method to determine whether this Component is currently disabled.</p> <p>Method to determine whether this Component is draggable.</p> <p>Method to determine whether this Component is droppable.</p> <p>Method to determine whether this Component is floating.</p> <p>Method to determine whether this Component is currently set to hidden.</p> <p>Determines whether this Component is the root of a layout. This returns <code>true</code> if this component can run its layout without assistance from or impact on its owner. If this component cannot run its layout given these restrictions, <code>false</code> is returned and its owner will be considered as the next candidate for the layout root.</p> <p>Setting the <a href="#!/api/Ext.AbstractComponent-property-_isLayoutRoot" rel="Ext.AbstractComponent-property-_isLayoutRoot" class="docClass">_isLayoutRoot</a> property to <code>true</code> causes this method to always return <code>true</code>. This may be useful when updating a layout of a Container which shrink wraps content, and you know that it will not change size, and so can safely be the topmost participant in the layout run.</p> <p>Returns true if layout is suspended for this component. This can come from direct suspension of this component's layout activity (suspendLayouts) or if one of this component's containers is suspended.</p> <p>Returns true if this component is visible.</p> <p>Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended from the xtype (default) or whether it is directly of the xtype specified (shallow = true).</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); var isText = t.isXType('textfield'); // true var isBoxSubclass = t.isXType('field'); // true, descended from <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> var isBoxInstance = t.isXType('field', true); // false, not a direct <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> instance </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Moves a Component within the Container</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Returns the next node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextSibling" rel="Ext.AbstractComponent-method-nextSibling" class="docClass">nextSibling</a>.</p> <p>Returns the next sibling of this Component.</p> <p>Optionally selects the next sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>next()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextNode" rel="Ext.AbstractComponent-method-nextNode" class="docClass">nextNode</a></p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Template method called when this Component's DOM structure is created.</p> <p>At this point, this Component's (And all descendants') DOM structure <i>exists</i> but it has not been layed out (positioned and sized).</p> <p>Subclasses which override this to gain access to the structure at render time should call the parent class's method before attempting to access any child elements of the Component.</p> <p>Returns the previous node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree in reverse order to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousSibling" rel="Ext.AbstractComponent-method-previousSibling" class="docClass">previousSibling</a>.</p> <p>Returns the previous sibling of this Component.</p> <p>Optionally selects the previous sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>prev()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousNode" rel="Ext.AbstractComponent-method-previousNode" class="docClass">previousNode</a></p> <p>Retrieves all descendant components which match the passed selector. Executes an <a href="#!/api/Ext.ComponentQuery-method-query" rel="Ext.ComponentQuery-method-query" class="docClass">Ext.ComponentQuery.query</a> using this container as its root.</p> <p>Retrieves all descendant components which match the passed function. The function should return false for components that are to be excluded from the selection.</p> <p>Finds a component at any level under this container matching the id/itemId. This is a shorthand for calling ct.down('#' + id);</p> <p>Called by Component#doAutoRender</p> <p>Register a Container configured <code>floating: true</code> with this Component's <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a>.</p> <p>Components added in ths way will not participate in any layout, but will be rendered upon first show in the way that <a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Window</a>s are.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes a component from this container. Fires the <a href="#!/api/Ext.container.AbstractContainer-event-beforeremove" rel="Ext.container.AbstractContainer-event-beforeremove" class="docClass">beforeremove</a> event before removing, then fires the <a href="#!/api/Ext.container.AbstractContainer-event-remove" rel="Ext.container.AbstractContainer-event-remove" class="docClass">remove</a> event after the component has been removed.</p> <p>Removes all components from this container.</p> <p>Removes items in the childEls array based on the return value of a supplied test function. The function is called with a entry in childEls and if the test function return true, that entry is removed. If false, that entry is kept.</p> <p>Removes a CSS class from the top level element representing this component.</p> <p>Removes a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-removeUIClsFromElement" rel="Ext.AbstractComponent-method-removeUIClsFromElement" class="docClass">removeUIClsFromElement</a> and removes it from all elements of this component.</p> <p>Removes the docked item from the panel.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Method which removes a specified UI + uiCls from the components element. The cls which is added to the element will be: <code>this.baseCls + '-' + ui</code></p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Conditionally saves a single property from this object to the given state object. The idea is to only save state which has changed from the initial state so that current software settings do not override future software settings. Only those values that are user-changed state should be saved.</p> <p>Scrolls this Component's target element by the passed delta values, optionally animating.</p> <p>All of the following are equivalent:</p> <pre><code> comp.scrollBy(10, 10, true); comp.scrollBy([10, 10], true); comp.scrollBy({ x: 10, y: 10 }, true); </code></pre> <p>Ensures that all effects queued after sequenceFx is called on this object are run in sequence. This is the opposite of <a href="#!/api/Ext.util.Animate-method-syncFx" rel="Ext.util.Animate-method-syncFx" class="docClass">syncFx</a>.</p> <p>This method is called internally by <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">Ext.ZIndexManager</a> to signal that a floating Component has either been moved to the top of its zIndex stack, or pushed from the top of its zIndex stack.</p> <p>If a <em>Window</em> is superceded by another Window, deactivating it hides its shadow.</p> <p>This method also fires the <a href="#!/api/Ext.Component-event-activate" rel="Ext.Component-event-activate" class="docClass">activate</a> or <a href="#!/api/Ext.Component-event-deactivate" rel="Ext.Component-event-deactivate" class="docClass">deactivate</a> event depending on which action occurred.</p> <p>Sets the overflow on the content element of the component.</p> <p>Sets the body style according to the passed parameters.</p> <p>Enable or disable the component.</p> <p>Sets the dock position of this component in its parent panel. Note that this only has effect if this item is part of the dockedItems collection of a parent that has a DockLayout (note that any Panel has a DockLayout by default)</p> <p>Sets the height of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>Set the icon for the panel's header. See <a href="#!/api/Ext.panel.Header-cfg-icon" rel="Ext.panel.Header-cfg-icon" class="docClass">Ext.panel.Header.icon</a>. It will fire the <a href="#!/api/Ext.panel.Panel-event-iconchange" rel="Ext.panel.Panel-event-iconchange" class="docClass">iconchange</a> event after completion.</p> <p>Set the iconCls for the panel's header. See <a href="#!/api/Ext.panel.Header-cfg-iconCls" rel="Ext.panel.Header-cfg-iconCls" class="docClass">Ext.panel.Header.iconCls</a>. It will fire the <a href="#!/api/Ext.panel.Panel-event-iconclschange" rel="Ext.panel.Panel-event-iconclschange" class="docClass">iconclschange</a> event after completion.</p> <p>This method allows you to show or hide a LoadMask on top of this component.</p> <p>Sets the overflow x/y on the content element of the component. The x/y overflow values can be any valid CSS overflow (e.g., 'auto' or 'scroll'). By default, the value is 'hidden'. Passing null for one of the values will erase the inline style. Passing <code>undefined</code> will preserve the current value.</p> <p>Sets the page XY position of the component. To set the left and top instead, use <a href="#!/api/Ext.Component-method-setPosition" rel="Ext.Component-method-setPosition" class="docClass">setPosition</a>. This method fires the <a href="#!/api/Ext.Component-event-move" rel="Ext.Component-event-move" class="docClass">move</a> event.</p> <p>Sets the left and top of the component. To set the page XY position instead, use setPagePosition. This method fires the <a href="#!/api/Ext.AbstractComponent-event-move" rel="Ext.AbstractComponent-event-move" class="docClass">move</a> event.</p> <p>Sets the width and height of this Component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event. This method can accept either width and height as separate arguments, or you can pass a size object like <code>{width:10, height:20}</code>.</p> <p>Set a title for the panel's header. See <a href="#!/api/Ext.panel.Header-cfg-title" rel="Ext.panel.Header-cfg-title" class="docClass">Ext.panel.Header.title</a>.</p> <p>Sets the UI for the component. This will remove any existing UIs on the component. It will also loop through any uiCls set on the component and rename them so they include the new UI</p> <p>Convenience function to hide or show this component by boolean.</p> <p>Sets the width of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>Shows this Component, rendering it first if <a href="#!/api/Ext.Component-cfg-autoRender" rel="Ext.Component-cfg-autoRender" class="docClass">autoRender</a> or <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> are <code>true</code>.</p> <p>After being shown, a <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Component (such as a <a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>), is activated it and brought to the front of its <a href="#!/api/Ext.Component-property-zIndexManager" rel="Ext.Component-property-zIndexManager" class="docClass">z-index stack</a>.</p> <p>Displays component at specific xy position. A floating component (like a menu) is positioned relative to its ownerCt if any. Useful for popping up a context menu:</p> <pre><code>listeners: { itemcontextmenu: function(view, record, item, index, event, options) { <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.menu.Menu" rel="Ext.menu.Menu" class="docClass">Ext.menu.Menu</a>', { width: 100, height: 100, margin: '0 0 10 0', items: [{ text: 'regular item 1' },{ text: 'regular item 2' },{ text: 'regular item 3' }] }).showAt(event.getXY()); } } </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Ensures that all effects queued after syncFx is called on this object are run concurrently. This is the opposite of <a href="#!/api/Ext.util.Animate-method-sequenceFx" rel="Ext.util.Animate-method-sequenceFx" class="docClass">sequenceFx</a>.</p> <p>Sends this Component to the back of (lower z-index than) any other visible windows</p> <p>Brings this floating Component to the front of any other visible, floating Components managed by the same <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a></p> <p>If this Component is modal, inserts the modal mask just below this Component in the z-index stack.</p> <p>Shortcut for performing an <a href="#!/api/Ext.panel.Panel-method-expand" rel="Ext.panel.Panel-method-expand" class="docClass">expand</a> or <a href="#!/api/Ext.panel.Panel-method-collapse" rel="Ext.panel.Panel-method-collapse" class="docClass">collapse</a> based on the current state of the panel.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Walks up the <code>ownerCt</code> axis looking for an ancestor Container which matches the passed simple selector.</p> <p>Example:</p> <pre><code>var owningTabPanel = grid.up('tabpanel'); </code></pre> <p>Update the content area of a component.</p> <p>Sets the current box measurements of the component's underlying element.</p> <p>Updates this component's layout. If this update effects this components <a href="#!/api/Ext.AbstractComponent-property-ownerCt" rel="Ext.AbstractComponent-property-ownerCt" class="docClass">ownerCt</a>, that component's <code>updateLayout</code> method will be called to perform the layout instead. Otherwise, just this component (and its child items) will layout.</p> <p>Creates new Component.</p> <p>The configuration options may be specified as either:</p> <ul> <li><strong>an element</strong> : it is set as the internal element and its id used as the component id</li> <li><strong>a string</strong> : it is assumed to be the id of an existing element and is used as the component id</li> <li><strong>anything else</strong> : it is assumed to be a standard config object and is applied to the component</li> </ul> <p>Setting this property to <code>true</code> causes the <a href="#!/api/Ext.AbstractComponent-method-isLayoutRoot" rel="Ext.AbstractComponent-method-isLayoutRoot" class="docClass">isLayoutRoot</a> method to return <code>true</code> and stop the search for the top-most component for a layout.</p> <p>Indicates whether or not the component can be dragged.</p> <p>Only present for <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which were inserted as descendant items of floating Containers.</p> <p>Floating Components that are programatically <a href="#!/api/Ext.Component-event-render" rel="Ext.Component-event-render" class="docClass">rendered</a> will not have a <code>floatParent</code> property.</p> <p>For <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which are child items of a Container, the floatParent will be the floating ancestor Container which is responsible for the base z-index value of all its floating descendants. It provides a <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a> which provides z-indexing services for all its descendant floating Components.</p> <p>For example, the dropdown <a href="#!/api/Ext.view.BoundList" rel="Ext.view.BoundList" class="docClass">BoundList</a> of a ComboBox which is in a Window will have the Window as its <code>floatParent</code></p> <p>See <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> and <a href="#!/api/Ext.Component-property-zIndexManager" rel="Ext.Component-property-zIndexManager" class="docClass">zIndexManager</a></p> <p>Indicates the width of any framing elements which were added within the encapsulating element to provide graphical, rounded borders. See the <a href="#!/api/Ext.AbstractComponent-cfg-frame" rel="Ext.AbstractComponent-cfg-frame" class="docClass">frame</a> config.</p> <p>This is an object containing the frame width in pixels for all four sides of the Component containing the following properties:</p> <p>The MixedCollection containing all the child items of this container.</p> <p>This is an internal flag that you use when creating custom components. By default this is set to true which means that every component gets a mask when its disabled. Components like FieldContainer, FieldSet, Field, Button, Tab override this property to false since they want to implement custom disable logic.</p> <p>This Component's owner <a href="#!/api/Ext.container.Container" rel="Ext.container.Container" class="docClass">Container</a> (is set automatically when this Component is added to a Container).</p> <p><strong>Note</strong>: to access items within the Container see <a href="#!/api/Ext.AbstractComponent-cfg-itemId" rel="Ext.AbstractComponent-cfg-itemId" class="docClass">itemId</a>.</p> <p>Indicates whether or not the component has been rendered.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Only present for <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components after they have been rendered.</p> <p>A reference to the ZIndexManager which is managing this Component's z-index.</p> <p>The <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a> maintains a stack of floating Component z-indices, and also provides a single modal mask which is insert just beneath the topmost visible modal floating Component.</p> <p>Floating Components may be <a href="#!/api/Ext.Component-method-toFront" rel="Ext.Component-method-toFront" class="docClass">brought to the front</a> or <a href="#!/api/Ext.Component-method-toBack" rel="Ext.Component-method-toBack" class="docClass">sent to the back</a> of the z-index stack.</p> <p>This defaults to the global <a href="#!/api/Ext.WindowManager" rel="Ext.WindowManager" class="docClass">ZIndexManager</a> for floating Components that are programatically <a href="#!/api/Ext.Component-event-render" rel="Ext.Component-event-render" class="docClass">rendered</a>.</p> <p>For <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which are added to a Container, the ZIndexManager is acquired from the first ancestor Container found which is floating, or if not found the global <a href="#!/api/Ext.WindowManager" rel="Ext.WindowManager" class="docClass">ZIndexManager</a> is used.</p> <p>See <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> and <a href="#!/api/Ext.Component-property-floatParent" rel="Ext.Component-property-floatParent" class="docClass">floatParent</a></p> <p>Adds <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a>(s) to this Container.</p> <h2>Description:</h2> <ul> <li>Fires the <a href="#!/api/Ext.container.AbstractContainer-event-beforeadd" rel="Ext.container.AbstractContainer-event-beforeadd" class="docClass">beforeadd</a> event before adding.</li> <li>The Container's <a href="#!/api/Ext.container.AbstractContainer-cfg-defaults" rel="Ext.container.AbstractContainer-cfg-defaults" class="docClass">default config values</a> will be applied accordingly (see <code><a href="#!/api/Ext.container.AbstractContainer-cfg-defaults" rel="Ext.container.AbstractContainer-cfg-defaults" class="docClass">defaults</a></code> for details).</li> <li>Fires the <code><a href="#!/api/Ext.container.AbstractContainer-event-add" rel="Ext.container.AbstractContainer-event-add" class="docClass">add</a></code> event after the component has been added.</li> </ul> <h2>Notes:</h2> <p>If the Container is <strong>already rendered</strong> when <code>add</code> is called, it will render the newly added Component into its content area.</p> <p><strong>If</strong> the Container was configured with a size-managing <a href="#!/api/Ext.container.AbstractContainer-cfg-layout" rel="Ext.container.AbstractContainer-cfg-layout" class="docClass">layout</a> manager, the Container will recalculate its internal layout at this time too.</p> <p>Note that the default layout manager simply renders child Components sequentially into the content area and thereafter performs no sizing.</p> <p>If adding multiple new child Components, pass them as an array to the <code>add</code> method, so that only one layout recalculation is performed.</p> <pre><code>tb = new <a href="#!/api/Ext.toolbar.Toolbar" rel="Ext.toolbar.Toolbar" class="docClass">Ext.toolbar.Toolbar</a>({ renderTo: document.body }); // toolbar is rendered // add multiple items. // (<a href="#!/api/Ext.container.AbstractContainer-cfg-defaultType" rel="Ext.container.AbstractContainer-cfg-defaultType" class="docClass">defaultType</a> for <a href="#!/api/Ext.toolbar.Toolbar" rel="Ext.toolbar.Toolbar" class="docClass">Toolbar</a> is 'button') tb.add([{text:'Button 1'}, {text:'Button 2'}]); </code></pre> <p>To inject components between existing ones, use the <a href="#!/api/Ext.container.AbstractContainer-method-insert" rel="Ext.container.AbstractContainer-method-insert" class="docClass">insert</a> method.</p> <h2>Warning:</h2> <p>Components directly managed by the BorderLayout layout manager may not be removed or added. See the Notes for <a href="#!/api/Ext.layout.container.Border" rel="Ext.layout.container.Border" class="docClass">BorderLayout</a> for more details.</p> <p>Adds each argument passed to this method to the childEls array.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-addUIClsToElement" rel="Ext.AbstractComponent-method-addUIClsToElement" class="docClass">addUIClsToElement</a> and adds to all elements of this component.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Save a property to the given state object if it is not its default or configured value.</p> <p>Add events that will trigger the state to be saved. If the first argument is an array, each element of that array is the name of a state event. Otherwise, each argument passed to this method is the name of a state event.</p> <p>Method which adds a specified UI + uiCls to the components element. Can be overridden to remove the UI from more than just the components element.</p> <p>Called by the layout system when the Component has been layed out.</p> <p>Aligns this floating Component to the specified element</p> <p>Perform custom animation on this object.</p> <p>This method is applicable to both the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a> class and the <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a> class. It performs animated transitions of certain properties of this object over a specified timeline.</p> <p>The sole parameter is an object which specifies start property values, end property values, and properties which describe the timeline.</p> <h3>Animating an <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a></h3> <p>When animating an Element, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The page X position in pixels.</p></li> <li><p><code>y</code> - The page Y position in pixels</p></li> <li><p><code>left</code> - The element's CSS <code>left</code> value. Units must be supplied.</p></li> <li><p><code>top</code> - The element's CSS <code>top</code> value. Units must be supplied.</p></li> <li><p><code>width</code> - The element's CSS <code>width</code> value. Units must be supplied.</p></li> <li><p><code>height</code> - The element's CSS <code>height</code> value. Units must be supplied.</p></li> <li><p><code>scrollLeft</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>scrollTop</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>opacity</code> - The element's <code>opacity</code> value. This must be a value between <code>0</code> and <code>1</code>.</p></li> </ul> <p><strong>Be aware than animating an Element which is being used by an Ext Component without in some way informing the Component about the changed element state will result in incorrect Component behaviour. This is because the Component will be using the old state of the element. To avoid this problem, it is now possible to directly animate certain properties of Components.</strong></p> <h3>Animating a <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a></h3> <p>When animating a Component, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The Component's page X position in pixels.</p></li> <li><p><code>y</code> - The Component's page Y position in pixels</p></li> <li><p><code>left</code> - The Component's <code>left</code> value in pixels.</p></li> <li><p><code>top</code> - The Component's <code>top</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>dynamic</code> - Specify as true to update the Component's layout (if it is a Container) at every frame of the animation. <em>Use sparingly as laying out on every intermediate size change is an expensive operation.</em></p></li> </ul> <p>For example, to animate a Window to a new size, ensuring that its internal layout, and any shadow is correct:</p> <pre><code>myWindow = <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>', { title: 'Test Component animation', width: 500, height: 300, layout: { type: 'hbox', align: 'stretch' }, items: [{ title: 'Left: 33%', margins: '5 0 5 5', flex: 1 }, { title: 'Left: 66%', margins: '5 5 5 5', flex: 2 }] }); myWindow.show(); myWindow.header.el.on('click', function() { myWindow.animate({ to: { width: (myWindow.getWidth() == 500) ? 700 : 500, height: (myWindow.getHeight() == 300) ? 400 : 300, } }); }); </code></pre> <p>For performance reasons, by default, the internal layout is only updated when the Window reaches its final <code>"to"</code> size. If dynamic updating of the Window's child Components is required, then configure the animation with <code>dynamic: true</code> and the two child items will maintain their proportions during the animation.</p> <p>Applies the state to the object. This should be overridden in subclasses to do more complex state operations. By default it applies the state properties onto the current object.</p> <p>Utility wrapper that suspends layouts of all components for the duration of a given function.</p> <p>Occurs before componentLayout is run. Returning false from this method will prevent the componentLayout from being executed.</p> <p>Occurs before componentLayout is run. Returning false from this method will prevent the containerLayout from being executed.</p> <p>Bubbles up the component/container heirarchy, calling the specified function with each component. The scope (<em>this</em>) of function call will be the scope provided or the current component. The arguments to the function will be the args provided or the current component. If the function returns false at any point, the bubble is stopped.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Cascades down the component/container heirarchy from this component (passed in the first call), calling the specified function with each component. The scope (this reference) of the function call will be the scope provided or the current component. The arguments to the function will be the args provided or the current component. If the function returns false at any point, the cascade is stopped on that branch.</p> <p>Center this Component in its container.</p> <p>Retrieves the first direct child of this container which matches the passed selector. The passed in selector must comply with an <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">Ext.ComponentQuery</a> selector.</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Clone the current component using the original config values passed into this instance by default.</p> <p>Ensures that the plugins array contains fully constructed plugin instances. This converts any configs into their appropriate instances.</p> <p>Destroys the Component.</p> <p>Disable the component.</p> <p>Handles autoRender. Floating Components may have an ownerCt. If they are asking to be constrained, constrain them within that ownerCt, and have their z-index managed locally. Floating Components are always rendered to document.body</p> <p>This method needs to be called whenever you change something on this component that requires the Component's layout to be recalculated.</p> <p>Moves this floating Component into a constrain region.</p> <p>By default, this Component is constrained to be within the container it was added to, or the element it was rendered to.</p> <p>An alternative constraint may be passed.</p> <p>Manually force this container's layout to be recalculated. The framework uses this internally to refresh layouts form most cases.</p> <p>Retrieves the first descendant of this container which matches the passed selector. The passed in selector must comply with an <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">Ext.ComponentQuery</a> selector.</p> <p>Enable the component</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Ensures that this component is attached to <code>document.body</code>. If the component was rendered to Ext.getDetachedBody, then it will be appended to <code>document.body</code>. Any configured position is also restored.</p> <p>Find a container above this component at any level by a custom function. If the passed function returns true, the container will be returned.</p> <p>Find a container above this component at any level by xtype or class</p> <p>See also the <a href="#!/api/Ext.Component-method-up" rel="Ext.Component-method-up" class="docClass">up</a> method.</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Try to focus this component.</p> <p>Forces this component to redo its componentLayout.</p> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Gets the current box measurements of the component's underlying element.</p> <p>Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy.</p> <p>Return the immediate child Component in which the passed element is located.</p> <p>Examines this container's <a href="#!/api/Ext.container.AbstractContainer-property-items" rel="Ext.container.AbstractContainer-property-items" class="docClass">items</a> <strong>property</strong> and gets a direct child component of this container.</p> <p>Retrieves the top level element representing this component.</p> <p>Gets the current height of the component's underlying element.</p> <p>Retrieves the id of this component. Will autogenerate an id if one has not already been set.</p> <p>This function takes the position argument passed to onRender and returns a DOM element that you can use in the insertBefore.</p> <p>Returns the <a href="#!/api/Ext.layout.container.Container" rel="Ext.layout.container.Container" class="docClass">layout</a> instance currently associated with this Container. If a layout has not been instantiated yet, that is done first</p> <p>Gets the <a href="#!/api/Ext.ComponentLoader" rel="Ext.ComponentLoader" class="docClass">Ext.ComponentLoader</a> for this Component.</p> <p>Retrieves a plugin by its pluginId which has been bound to this component.</p> <p>Gets the current XY position of the component's underlying element.</p> <p>Gets the current size of the component's underlying element.</p> <p>Returns an object that describes how this component's width and height is managed. These objects are shared and should not be modified.</p> <p>The supplied default state gathering method for the AbstractComponent class.</p> <p>This method returns dimension settings such as <code>flex</code>, <code>anchor</code>, <code>width</code> and <code>height</code> along with <code>collapsed</code> state.</p> <p>Subclasses which implement more complex state should call the superclass's implementation, and apply their state to the result if this basic state is to be saved.</p> <p>Note that Component state will only be saved if the Component has a <a href="#!/api/Ext.AbstractComponent-cfg-stateId" rel="Ext.AbstractComponent-cfg-stateId" class="docClass">stateId</a> and there as a StateProvider configured for the document.</p> <p>Gets the state id for this object.</p> <p>Gets the current width of the component's underlying element.</p> <p>Gets the xtype for this component as registered with <a href="#!/api/Ext.ComponentManager" rel="Ext.ComponentManager" class="docClass">Ext.ComponentManager</a>. For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header. Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); alert(t.getXType()); // alerts 'textfield' </code></pre> <p>Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); alert(t.getXTypes()); // alerts 'component/field/textfield' </code></pre> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Checks if the specified CSS class exists on this element's DOM node.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Checks if there is currently a specified uiCls</p> <p>Hides this Component, setting it to invisible using the configured <a href="#!/api/Ext.Component-cfg-hideMode" rel="Ext.Component-cfg-hideMode" class="docClass">hideMode</a>.</p> <p>The initComponent template method is an important initialization step for a Component. It is intended to be implemented by each subclass of <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> to provide any needed constructor logic. The initComponent method of the class being created is called first, with each initComponent method up the hierarchy to <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> being called thereafter. This makes it easy to implement and, if needed, override the constructor logic of the Component at any step in the hierarchy.</p> <p>The initComponent method <strong>must</strong> contain a call to <a href="#!/api/Ext.Base-method-callParent" rel="Ext.Base-method-callParent" class="docClass">callParent</a> in order to ensure that the parent class' initComponent method is also called.</p> <p>All config options passed to the constructor are applied to <code>this</code> before initComponent is called, so you can simply access them with <code>this.someOption</code>.</p> <p>The following example demonstrates using a dynamic string for the text of a button at the time of instantiation of the class.</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('DynamicButtonText', { extend: '<a href="#!/api/Ext.button.Button" rel="Ext.button.Button" class="docClass">Ext.button.Button</a>', initComponent: function() { this.text = new Date(); this.renderTo = <a href="#!/api/Ext-method-getBody" rel="Ext-method-getBody" class="docClass">Ext.getBody</a>(); this.callParent(); } }); <a href="#!/api/Ext-method-onReady" rel="Ext-method-onReady" class="docClass">Ext.onReady</a>(function() { <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('DynamicButtonText'); }); </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Inserts a Component into this Container at a specified index. Fires the <a href="#!/api/Ext.container.AbstractContainer-event-beforeadd" rel="Ext.container.AbstractContainer-event-beforeadd" class="docClass">beforeadd</a> event before inserting, then fires the <a href="#!/api/Ext.container.AbstractContainer-event-add" rel="Ext.container.AbstractContainer-event-add" class="docClass">add</a> event after the Component has been inserted.</p> <p>Tests whether this Component matches the selector string.</p> <p>Determines whether <strong>this Container</strong> is an ancestor of the passed Component. This will return <code>true</code> if the passed Component is anywhere within the subtree beneath this Container.</p> <p>Determines whether this component is the descendant of a particular container.</p> <p>Method to determine whether this Component is currently disabled.</p> <p>Method to determine whether this Component is draggable.</p> <p>Method to determine whether this Component is droppable.</p> <p>Method to determine whether this Component is floating.</p> <p>Method to determine whether this Component is currently set to hidden.</p> <p>Determines whether this Component is the root of a layout. This returns <code>true</code> if this component can run its layout without assistance from or impact on its owner. If this component cannot run its layout given these restrictions, <code>false</code> is returned and its owner will be considered as the next candidate for the layout root.</p> <p>Setting the <a href="#!/api/Ext.AbstractComponent-property-_isLayoutRoot" rel="Ext.AbstractComponent-property-_isLayoutRoot" class="docClass">_isLayoutRoot</a> property to <code>true</code> causes this method to always return <code>true</code>. This may be useful when updating a layout of a Container which shrink wraps content, and you know that it will not change size, and so can safely be the topmost participant in the layout run.</p> <p>Returns true if layout is suspended for this component. This can come from direct suspension of this component's layout activity (suspendLayouts) or if one of this component's containers is suspended.</p> <p>Returns true if this component is visible.</p> <p>Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended from the xtype (default) or whether it is directly of the xtype specified (shallow = true).</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); var isText = t.isXType('textfield'); // true var isBoxSubclass = t.isXType('field'); // true, descended from <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> var isBoxInstance = t.isXType('field', true); // false, not a direct <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> instance </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Moves a Component within the Container</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Returns the next node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextSibling" rel="Ext.AbstractComponent-method-nextSibling" class="docClass">nextSibling</a>.</p> <p>Returns the next sibling of this Component.</p> <p>Optionally selects the next sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>next()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextNode" rel="Ext.AbstractComponent-method-nextNode" class="docClass">nextNode</a></p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Template method called when this Component's DOM structure is created.</p> <p>At this point, this Component's (And all descendants') DOM structure <i>exists</i> but it has not been layed out (positioned and sized).</p> <p>Subclasses which override this to gain access to the structure at render time should call the parent class's method before attempting to access any child elements of the Component.</p> <p>Returns the previous node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree in reverse order to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousSibling" rel="Ext.AbstractComponent-method-previousSibling" class="docClass">previousSibling</a>.</p> <p>Returns the previous sibling of this Component.</p> <p>Optionally selects the previous sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>prev()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousNode" rel="Ext.AbstractComponent-method-previousNode" class="docClass">previousNode</a></p> <p>Retrieves all descendant components which match the passed selector. Executes an <a href="#!/api/Ext.ComponentQuery-method-query" rel="Ext.ComponentQuery-method-query" class="docClass">Ext.ComponentQuery.query</a> using this container as its root.</p> <p>Retrieves all descendant components which match the passed function. The function should return false for components that are to be excluded from the selection.</p> <p>Finds a component at any level under this container matching the id/itemId. This is a shorthand for calling ct.down('#' + id);</p> <p>Called by Component#doAutoRender</p> <p>Register a Container configured <code>floating: true</code> with this Component's <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a>.</p> <p>Components added in ths way will not participate in any layout, but will be rendered upon first show in the way that <a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Window</a>s are.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes a component from this container. Fires the <a href="#!/api/Ext.container.AbstractContainer-event-beforeremove" rel="Ext.container.AbstractContainer-event-beforeremove" class="docClass">beforeremove</a> event before removing, then fires the <a href="#!/api/Ext.container.AbstractContainer-event-remove" rel="Ext.container.AbstractContainer-event-remove" class="docClass">remove</a> event after the component has been removed.</p> <p>Removes all components from this container.</p> <p>Removes items in the childEls array based on the return value of a supplied test function. The function is called with a entry in childEls and if the test function return true, that entry is removed. If false, that entry is kept.</p> <p>Removes a CSS class from the top level element representing this component.</p> <p>Removes a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-removeUIClsFromElement" rel="Ext.AbstractComponent-method-removeUIClsFromElement" class="docClass">removeUIClsFromElement</a> and removes it from all elements of this component.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Method which removes a specified UI + uiCls from the components element. The cls which is added to the element will be: <code>this.baseCls + '-' + ui</code></p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Conditionally saves a single property from this object to the given state object. The idea is to only save state which has changed from the initial state so that current software settings do not override future software settings. Only those values that are user-changed state should be saved.</p> <p>Scrolls this Component's target element by the passed delta values, optionally animating.</p> <p>All of the following are equivalent:</p> <pre><code> comp.scrollBy(10, 10, true); comp.scrollBy([10, 10], true); comp.scrollBy({ x: 10, y: 10 }, true); </code></pre> <p>Ensures that all effects queued after sequenceFx is called on this object are run in sequence. This is the opposite of <a href="#!/api/Ext.util.Animate-method-syncFx" rel="Ext.util.Animate-method-syncFx" class="docClass">syncFx</a>.</p> <p>This method is called internally by <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">Ext.ZIndexManager</a> to signal that a floating Component has either been moved to the top of its zIndex stack, or pushed from the top of its zIndex stack.</p> <p>If a <em>Window</em> is superceded by another Window, deactivating it hides its shadow.</p> <p>This method also fires the <a href="#!/api/Ext.Component-event-activate" rel="Ext.Component-event-activate" class="docClass">activate</a> or <a href="#!/api/Ext.Component-event-deactivate" rel="Ext.Component-event-deactivate" class="docClass">deactivate</a> event depending on which action occurred.</p> <p>Sets the overflow on the content element of the component.</p> <p>Enable or disable the component.</p> <p>Sets the dock position of this component in its parent panel. Note that this only has effect if this item is part of the dockedItems collection of a parent that has a DockLayout (note that any Panel has a DockLayout by default)</p> <p>Sets the height of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>This method allows you to show or hide a LoadMask on top of this component.</p> <p>Sets the overflow x/y on the content element of the component. The x/y overflow values can be any valid CSS overflow (e.g., 'auto' or 'scroll'). By default, the value is 'hidden'. Passing null for one of the values will erase the inline style. Passing <code>undefined</code> will preserve the current value.</p> <p>Sets the page XY position of the component. To set the left and top instead, use <a href="#!/api/Ext.Component-method-setPosition" rel="Ext.Component-method-setPosition" class="docClass">setPosition</a>. This method fires the <a href="#!/api/Ext.Component-event-move" rel="Ext.Component-event-move" class="docClass">move</a> event.</p> <p>Sets the left and top of the component. To set the page XY position instead, use setPagePosition. This method fires the <a href="#!/api/Ext.AbstractComponent-event-move" rel="Ext.AbstractComponent-event-move" class="docClass">move</a> event.</p> <p>Sets the width and height of this Component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event. This method can accept either width and height as separate arguments, or you can pass a size object like <code>{width:10, height:20}</code>.</p> <p>Sets the UI for the component. This will remove any existing UIs on the component. It will also loop through any uiCls set on the component and rename them so they include the new UI</p> <p>Convenience function to hide or show this component by boolean.</p> <p>Sets the width of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>Shows this Component, rendering it first if <a href="#!/api/Ext.Component-cfg-autoRender" rel="Ext.Component-cfg-autoRender" class="docClass">autoRender</a> or <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> are <code>true</code>.</p> <p>After being shown, a <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Component (such as a <a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>), is activated it and brought to the front of its <a href="#!/api/Ext.Component-property-zIndexManager" rel="Ext.Component-property-zIndexManager" class="docClass">z-index stack</a>.</p> <p>Displays component at specific xy position. A floating component (like a menu) is positioned relative to its ownerCt if any. Useful for popping up a context menu:</p> <pre><code>listeners: { itemcontextmenu: function(view, record, item, index, event, options) { <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.menu.Menu" rel="Ext.menu.Menu" class="docClass">Ext.menu.Menu</a>', { width: 100, height: 100, margin: '0 0 10 0', items: [{ text: 'regular item 1' },{ text: 'regular item 2' },{ text: 'regular item 3' }] }).showAt(event.getXY()); } } </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Ensures that all effects queued after syncFx is called on this object are run concurrently. This is the opposite of <a href="#!/api/Ext.util.Animate-method-sequenceFx" rel="Ext.util.Animate-method-sequenceFx" class="docClass">sequenceFx</a>.</p> <p>Sends this Component to the back of (lower z-index than) any other visible windows</p> <p>Brings this floating Component to the front of any other visible, floating Components managed by the same <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a></p> <p>If this Component is modal, inserts the modal mask just below this Component in the z-index stack.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Walks up the <code>ownerCt</code> axis looking for an ancestor Container which matches the passed simple selector.</p> <p>Example:</p> <pre><code>var owningTabPanel = grid.up('tabpanel'); </code></pre> <p>Update the content area of a component.</p> <p>Sets the current box measurements of the component's underlying element.</p> <p>Updates this component's layout. If this update effects this components <a href="#!/api/Ext.AbstractComponent-property-ownerCt" rel="Ext.AbstractComponent-property-ownerCt" class="docClass">ownerCt</a>, that component's <code>updateLayout</code> method will be called to perform the layout instead. Otherwise, just this component (and its child items) will layout.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Adds docked item(s) to the container.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Finds a docked component by id, itemId or position. Also see <a href="#!/api/Ext.container.DockingContainer-method-getDockedItems" rel="Ext.container.DockingContainer-method-getDockedItems" class="docClass">getDockedItems</a></p> <p>Retrieves an array of all currently docked Components.</p> <p>For example to find a toolbar that has been docked at top:</p> <pre><code>panel.getDockedItems('toolbar[dock="top"]'); </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Inserts docked item(s) to the panel at the indicated position.</p> <p>Removes the docked item from the panel.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Creates new Component.</p> <p>The configuration options may be specified as either:</p> <ul> <li><strong>an element</strong> : it is set as the internal element and its id used as the component id</li> <li><strong>a string</strong> : it is assumed to be the id of an existing element and is used as the component id</li> <li><strong>anything else</strong> : it is assumed to be a standard config object and is applied to the component</li> </ul> <p>Setting this property to <code>true</code> causes the <a href="#!/api/Ext.AbstractComponent-method-isLayoutRoot" rel="Ext.AbstractComponent-method-isLayoutRoot" class="docClass">isLayoutRoot</a> method to return <code>true</code> and stop the search for the top-most component for a layout.</p> <p>Indicates whether or not the component can be dragged.</p> <p>Only present for <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which were inserted as descendant items of floating Containers.</p> <p>Floating Components that are programatically <a href="#!/api/Ext.Component-event-render" rel="Ext.Component-event-render" class="docClass">rendered</a> will not have a <code>floatParent</code> property.</p> <p>For <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which are child items of a Container, the floatParent will be the floating ancestor Container which is responsible for the base z-index value of all its floating descendants. It provides a <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a> which provides z-indexing services for all its descendant floating Components.</p> <p>For example, the dropdown <a href="#!/api/Ext.view.BoundList" rel="Ext.view.BoundList" class="docClass">BoundList</a> of a ComboBox which is in a Window will have the Window as its <code>floatParent</code></p> <p>See <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> and <a href="#!/api/Ext.Component-property-zIndexManager" rel="Ext.Component-property-zIndexManager" class="docClass">zIndexManager</a></p> <p>Indicates the width of any framing elements which were added within the encapsulating element to provide graphical, rounded borders. See the <a href="#!/api/Ext.AbstractComponent-cfg-frame" rel="Ext.AbstractComponent-cfg-frame" class="docClass">frame</a> config.</p> <p>This is an object containing the frame width in pixels for all four sides of the Component containing the following properties:</p> <p>The MixedCollection containing all the child items of this container.</p> <p>This is an internal flag that you use when creating custom components. By default this is set to true which means that every component gets a mask when its disabled. Components like FieldContainer, FieldSet, Field, Button, Tab override this property to false since they want to implement custom disable logic.</p> <p>This Component's owner <a href="#!/api/Ext.container.Container" rel="Ext.container.Container" class="docClass">Container</a> (is set automatically when this Component is added to a Container).</p> <p><strong>Note</strong>: to access items within the Container see <a href="#!/api/Ext.AbstractComponent-cfg-itemId" rel="Ext.AbstractComponent-cfg-itemId" class="docClass">itemId</a>.</p> <p>Indicates whether or not the component has been rendered.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Only present for <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components after they have been rendered.</p> <p>A reference to the ZIndexManager which is managing this Component's z-index.</p> <p>The <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a> maintains a stack of floating Component z-indices, and also provides a single modal mask which is insert just beneath the topmost visible modal floating Component.</p> <p>Floating Components may be <a href="#!/api/Ext.Component-method-toFront" rel="Ext.Component-method-toFront" class="docClass">brought to the front</a> or <a href="#!/api/Ext.Component-method-toBack" rel="Ext.Component-method-toBack" class="docClass">sent to the back</a> of the z-index stack.</p> <p>This defaults to the global <a href="#!/api/Ext.WindowManager" rel="Ext.WindowManager" class="docClass">ZIndexManager</a> for floating Components that are programatically <a href="#!/api/Ext.Component-event-render" rel="Ext.Component-event-render" class="docClass">rendered</a>.</p> <p>For <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Components which are added to a Container, the ZIndexManager is acquired from the first ancestor Container found which is floating, or if not found the global <a href="#!/api/Ext.WindowManager" rel="Ext.WindowManager" class="docClass">ZIndexManager</a> is used.</p> <p>See <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> and <a href="#!/api/Ext.Component-property-floatParent" rel="Ext.Component-property-floatParent" class="docClass">floatParent</a></p> <p>Adds <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a>(s) to this Container.</p> <h2>Description:</h2> <ul> <li>Fires the <a href="#!/api/Ext.container.AbstractContainer-event-beforeadd" rel="Ext.container.AbstractContainer-event-beforeadd" class="docClass">beforeadd</a> event before adding.</li> <li>The Container's <a href="#!/api/Ext.container.AbstractContainer-cfg-defaults" rel="Ext.container.AbstractContainer-cfg-defaults" class="docClass">default config values</a> will be applied accordingly (see <code><a href="#!/api/Ext.container.AbstractContainer-cfg-defaults" rel="Ext.container.AbstractContainer-cfg-defaults" class="docClass">defaults</a></code> for details).</li> <li>Fires the <code><a href="#!/api/Ext.container.AbstractContainer-event-add" rel="Ext.container.AbstractContainer-event-add" class="docClass">add</a></code> event after the component has been added.</li> </ul> <h2>Notes:</h2> <p>If the Container is <strong>already rendered</strong> when <code>add</code> is called, it will render the newly added Component into its content area.</p> <p><strong>If</strong> the Container was configured with a size-managing <a href="#!/api/Ext.container.AbstractContainer-cfg-layout" rel="Ext.container.AbstractContainer-cfg-layout" class="docClass">layout</a> manager, the Container will recalculate its internal layout at this time too.</p> <p>Note that the default layout manager simply renders child Components sequentially into the content area and thereafter performs no sizing.</p> <p>If adding multiple new child Components, pass them as an array to the <code>add</code> method, so that only one layout recalculation is performed.</p> <pre><code>tb = new <a href="#!/api/Ext.toolbar.Toolbar" rel="Ext.toolbar.Toolbar" class="docClass">Ext.toolbar.Toolbar</a>({ renderTo: document.body }); // toolbar is rendered // add multiple items. // (<a href="#!/api/Ext.container.AbstractContainer-cfg-defaultType" rel="Ext.container.AbstractContainer-cfg-defaultType" class="docClass">defaultType</a> for <a href="#!/api/Ext.toolbar.Toolbar" rel="Ext.toolbar.Toolbar" class="docClass">Toolbar</a> is 'button') tb.add([{text:'Button 1'}, {text:'Button 2'}]); </code></pre> <p>To inject components between existing ones, use the <a href="#!/api/Ext.container.AbstractContainer-method-insert" rel="Ext.container.AbstractContainer-method-insert" class="docClass">insert</a> method.</p> <h2>Warning:</h2> <p>Components directly managed by the BorderLayout layout manager may not be removed or added. See the Notes for <a href="#!/api/Ext.layout.container.Border" rel="Ext.layout.container.Border" class="docClass">BorderLayout</a> for more details.</p> <p>Adds each argument passed to this method to the childEls array.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a CSS class to the top level element representing this component.</p> <p>Adds a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-addUIClsToElement" rel="Ext.AbstractComponent-method-addUIClsToElement" class="docClass">addUIClsToElement</a> and adds to all elements of this component.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Save a property to the given state object if it is not its default or configured value.</p> <p>Add events that will trigger the state to be saved. If the first argument is an array, each element of that array is the name of a state event. Otherwise, each argument passed to this method is the name of a state event.</p> <p>Method which adds a specified UI + uiCls to the components element. Can be overridden to remove the UI from more than just the components element.</p> <p>Called by the layout system when the Component has been layed out.</p> <p>Aligns this floating Component to the specified element</p> <p>Perform custom animation on this object.</p> <p>This method is applicable to both the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a> class and the <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a> class. It performs animated transitions of certain properties of this object over a specified timeline.</p> <p>The sole parameter is an object which specifies start property values, end property values, and properties which describe the timeline.</p> <h3>Animating an <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Element</a></h3> <p>When animating an Element, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The page X position in pixels.</p></li> <li><p><code>y</code> - The page Y position in pixels</p></li> <li><p><code>left</code> - The element's CSS <code>left</code> value. Units must be supplied.</p></li> <li><p><code>top</code> - The element's CSS <code>top</code> value. Units must be supplied.</p></li> <li><p><code>width</code> - The element's CSS <code>width</code> value. Units must be supplied.</p></li> <li><p><code>height</code> - The element's CSS <code>height</code> value. Units must be supplied.</p></li> <li><p><code>scrollLeft</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>scrollTop</code> - The element's <code>scrollLeft</code> value.</p></li> <li><p><code>opacity</code> - The element's <code>opacity</code> value. This must be a value between <code>0</code> and <code>1</code>.</p></li> </ul> <p><strong>Be aware than animating an Element which is being used by an Ext Component without in some way informing the Component about the changed element state will result in incorrect Component behaviour. This is because the Component will be using the old state of the element. To avoid this problem, it is now possible to directly animate certain properties of Components.</strong></p> <h3>Animating a <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Component</a></h3> <p>When animating a Component, the following properties may be specified in <code>from</code>, <code>to</code>, and <code>keyframe</code> objects:</p> <ul> <li><p><code>x</code> - The Component's page X position in pixels.</p></li> <li><p><code>y</code> - The Component's page Y position in pixels</p></li> <li><p><code>left</code> - The Component's <code>left</code> value in pixels.</p></li> <li><p><code>top</code> - The Component's <code>top</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>width</code> - The Component's <code>width</code> value in pixels.</p></li> <li><p><code>dynamic</code> - Specify as true to update the Component's layout (if it is a Container) at every frame of the animation. <em>Use sparingly as laying out on every intermediate size change is an expensive operation.</em></p></li> </ul> <p>For example, to animate a Window to a new size, ensuring that its internal layout, and any shadow is correct:</p> <pre><code>myWindow = <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>', { title: 'Test Component animation', width: 500, height: 300, layout: { type: 'hbox', align: 'stretch' }, items: [{ title: 'Left: 33%', margins: '5 0 5 5', flex: 1 }, { title: 'Left: 66%', margins: '5 5 5 5', flex: 2 }] }); myWindow.show(); myWindow.header.el.on('click', function() { myWindow.animate({ to: { width: (myWindow.getWidth() == 500) ? 700 : 500, height: (myWindow.getHeight() == 300) ? 400 : 300, } }); }); </code></pre> <p>For performance reasons, by default, the internal layout is only updated when the Window reaches its final <code>"to"</code> size. If dynamic updating of the Window's child Components is required, then configure the animation with <code>dynamic: true</code> and the two child items will maintain their proportions during the animation.</p> <p>Applies the state to the object. This should be overridden in subclasses to do more complex state operations. By default it applies the state properties onto the current object.</p> <p>Utility wrapper that suspends layouts of all components for the duration of a given function.</p> <p>Occurs before componentLayout is run. Returning false from this method will prevent the componentLayout from being executed.</p> <p>Occurs before componentLayout is run. Returning false from this method will prevent the containerLayout from being executed.</p> <p>Bubbles up the component/container heirarchy, calling the specified function with each component. The scope (<em>this</em>) of function call will be the scope provided or the current component. The arguments to the function will be the args provided or the current component. If the function returns false at any point, the bubble is stopped.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Cascades down the component/container heirarchy from this component (passed in the first call), calling the specified function with each component. The scope (this reference) of the function call will be the scope provided or the current component. The arguments to the function will be the args provided or the current component. If the function returns false at any point, the cascade is stopped on that branch.</p> <p>Center this Component in its container.</p> <p>Retrieves the first direct child of this container which matches the passed selector. The passed in selector must comply with an <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">Ext.ComponentQuery</a> selector.</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Clone the current component using the original config values passed into this instance by default.</p> <p>Ensures that the plugins array contains fully constructed plugin instances. This converts any configs into their appropriate instances.</p> <p>Destroys the Component.</p> <p>Disable the component.</p> <p>Handles autoRender. Floating Components may have an ownerCt. If they are asking to be constrained, constrain them within that ownerCt, and have their z-index managed locally. Floating Components are always rendered to document.body</p> <p>This method needs to be called whenever you change something on this component that requires the Component's layout to be recalculated.</p> <p>Moves this floating Component into a constrain region.</p> <p>By default, this Component is constrained to be within the container it was added to, or the element it was rendered to.</p> <p>An alternative constraint may be passed.</p> <p>Manually force this container's layout to be recalculated. The framework uses this internally to refresh layouts form most cases.</p> <p>Retrieves the first descendant of this container which matches the passed selector. The passed in selector must comply with an <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">Ext.ComponentQuery</a> selector.</p> <p>Enable the component</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Ensures that this component is attached to <code>document.body</code>. If the component was rendered to Ext.getDetachedBody, then it will be appended to <code>document.body</code>. Any configured position is also restored.</p> <p>Find a container above this component at any level by a custom function. If the passed function returns true, the container will be returned.</p> <p>Find a container above this component at any level by xtype or class</p> <p>See also the <a href="#!/api/Ext.Component-method-up" rel="Ext.Component-method-up" class="docClass">up</a> method.</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Try to focus this component.</p> <p>Forces this component to redo its componentLayout.</p> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Gets the current box measurements of the component's underlying element.</p> <p>Provides the link for Observable's fireEvent method to bubble up the ownership hierarchy.</p> <p>Return the immediate child Component in which the passed element is located.</p> <p>Examines this container's <a href="#!/api/Ext.container.AbstractContainer-property-items" rel="Ext.container.AbstractContainer-property-items" class="docClass">items</a> <strong>property</strong> and gets a direct child component of this container.</p> <p>Retrieves the top level element representing this component.</p> <p>Gets the current height of the component's underlying element.</p> <p>Retrieves the id of this component. Will autogenerate an id if one has not already been set.</p> <p>This function takes the position argument passed to onRender and returns a DOM element that you can use in the insertBefore.</p> <p>Returns the <a href="#!/api/Ext.layout.container.Container" rel="Ext.layout.container.Container" class="docClass">layout</a> instance currently associated with this Container. If a layout has not been instantiated yet, that is done first</p> <p>Gets the <a href="#!/api/Ext.ComponentLoader" rel="Ext.ComponentLoader" class="docClass">Ext.ComponentLoader</a> for this Component.</p> <p>Retrieves a plugin by its pluginId which has been bound to this component.</p> <p>Gets the current XY position of the component's underlying element.</p> <p>Gets the current size of the component's underlying element.</p> <p>Returns an object that describes how this component's width and height is managed. These objects are shared and should not be modified.</p> <p>The supplied default state gathering method for the AbstractComponent class.</p> <p>This method returns dimension settings such as <code>flex</code>, <code>anchor</code>, <code>width</code> and <code>height</code> along with <code>collapsed</code> state.</p> <p>Subclasses which implement more complex state should call the superclass's implementation, and apply their state to the result if this basic state is to be saved.</p> <p>Note that Component state will only be saved if the Component has a <a href="#!/api/Ext.AbstractComponent-cfg-stateId" rel="Ext.AbstractComponent-cfg-stateId" class="docClass">stateId</a> and there as a StateProvider configured for the document.</p> <p>Gets the state id for this object.</p> <p>Gets the current width of the component's underlying element.</p> <p>Gets the xtype for this component as registered with <a href="#!/api/Ext.ComponentManager" rel="Ext.ComponentManager" class="docClass">Ext.ComponentManager</a>. For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header. Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); alert(t.getXType()); // alerts 'textfield' </code></pre> <p>Returns this Component's xtype hierarchy as a slash-delimited string. For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); alert(t.getXTypes()); // alerts 'component/field/textfield' </code></pre> <p>Returns the current animation if this object has any effects actively running or queued, else returns false.</p> <p>Checks if the specified CSS class exists on this element's DOM node.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Checks if there is currently a specified uiCls</p> <p>Hides this Component, setting it to invisible using the configured <a href="#!/api/Ext.Component-cfg-hideMode" rel="Ext.Component-cfg-hideMode" class="docClass">hideMode</a>.</p> <p>The initComponent template method is an important initialization step for a Component. It is intended to be implemented by each subclass of <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> to provide any needed constructor logic. The initComponent method of the class being created is called first, with each initComponent method up the hierarchy to <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> being called thereafter. This makes it easy to implement and, if needed, override the constructor logic of the Component at any step in the hierarchy.</p> <p>The initComponent method <strong>must</strong> contain a call to <a href="#!/api/Ext.Base-method-callParent" rel="Ext.Base-method-callParent" class="docClass">callParent</a> in order to ensure that the parent class' initComponent method is also called.</p> <p>All config options passed to the constructor are applied to <code>this</code> before initComponent is called, so you can simply access them with <code>this.someOption</code>.</p> <p>The following example demonstrates using a dynamic string for the text of a button at the time of instantiation of the class.</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('DynamicButtonText', { extend: '<a href="#!/api/Ext.button.Button" rel="Ext.button.Button" class="docClass">Ext.button.Button</a>', initComponent: function() { this.text = new Date(); this.renderTo = <a href="#!/api/Ext-method-getBody" rel="Ext-method-getBody" class="docClass">Ext.getBody</a>(); this.callParent(); } }); <a href="#!/api/Ext-method-onReady" rel="Ext-method-onReady" class="docClass">Ext.onReady</a>(function() { <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('DynamicButtonText'); }); </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Inserts a Component into this Container at a specified index. Fires the <a href="#!/api/Ext.container.AbstractContainer-event-beforeadd" rel="Ext.container.AbstractContainer-event-beforeadd" class="docClass">beforeadd</a> event before inserting, then fires the <a href="#!/api/Ext.container.AbstractContainer-event-add" rel="Ext.container.AbstractContainer-event-add" class="docClass">add</a> event after the Component has been inserted.</p> <p>Tests whether this Component matches the selector string.</p> <p>Determines whether <strong>this Container</strong> is an ancestor of the passed Component. This will return <code>true</code> if the passed Component is anywhere within the subtree beneath this Container.</p> <p>Determines whether this component is the descendant of a particular container.</p> <p>Method to determine whether this Component is currently disabled.</p> <p>Method to determine whether this Component is draggable.</p> <p>Method to determine whether this Component is droppable.</p> <p>Method to determine whether this Component is floating.</p> <p>Method to determine whether this Component is currently set to hidden.</p> <p>Determines whether this Component is the root of a layout. This returns <code>true</code> if this component can run its layout without assistance from or impact on its owner. If this component cannot run its layout given these restrictions, <code>false</code> is returned and its owner will be considered as the next candidate for the layout root.</p> <p>Setting the <a href="#!/api/Ext.AbstractComponent-property-_isLayoutRoot" rel="Ext.AbstractComponent-property-_isLayoutRoot" class="docClass">_isLayoutRoot</a> property to <code>true</code> causes this method to always return <code>true</code>. This may be useful when updating a layout of a Container which shrink wraps content, and you know that it will not change size, and so can safely be the topmost participant in the layout run.</p> <p>Returns true if layout is suspended for this component. This can come from direct suspension of this component's layout activity (suspendLayouts) or if one of this component's containers is suspended.</p> <p>Returns true if this component is visible.</p> <p>Tests whether or not this Component is of a specific xtype. This can test whether this Component is descended from the xtype (default) or whether it is directly of the xtype specified (shallow = true).</p> <p><strong>If using your own subclasses, be aware that a Component must register its own xtype to participate in determination of inherited xtypes.</strong></p> <p>For a list of all available xtypes, see the <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> header.</p> <p>Example usage:</p> <pre><code>var t = new <a href="#!/api/Ext.form.field.Text" rel="Ext.form.field.Text" class="docClass">Ext.form.field.Text</a>(); var isText = t.isXType('textfield'); // true var isBoxSubclass = t.isXType('field'); // true, descended from <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> var isBoxInstance = t.isXType('field', true); // false, not a direct <a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a> instance </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Moves a Component within the Container</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Returns the next node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextSibling" rel="Ext.AbstractComponent-method-nextSibling" class="docClass">nextSibling</a>.</p> <p>Returns the next sibling of this Component.</p> <p>Optionally selects the next sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>next()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-nextNode" rel="Ext.AbstractComponent-method-nextNode" class="docClass">nextNode</a></p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Template method called when this Component's DOM structure is created.</p> <p>At this point, this Component's (And all descendants') DOM structure <i>exists</i> but it has not been layed out (positioned and sized).</p> <p>Subclasses which override this to gain access to the structure at render time should call the parent class's method before attempting to access any child elements of the Component.</p> <p>Returns the previous node in the Component tree in tree traversal order.</p> <p>Note that this is not limited to siblings, and if invoked upon a node with no matching siblings, will walk the tree in reverse order to attempt to find a match. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousSibling" rel="Ext.AbstractComponent-method-previousSibling" class="docClass">previousSibling</a>.</p> <p>Returns the previous sibling of this Component.</p> <p>Optionally selects the previous sibling which matches the passed <a href="#!/api/Ext.ComponentQuery" rel="Ext.ComponentQuery" class="docClass">ComponentQuery</a> selector.</p> <p>May also be refered to as <strong><code>prev()</code></strong></p> <p>Note that this is limited to siblings, and if no siblings of the item match, <code>null</code> is returned. Contrast with <a href="#!/api/Ext.AbstractComponent-method-previousNode" rel="Ext.AbstractComponent-method-previousNode" class="docClass">previousNode</a></p> <p>Retrieves all descendant components which match the passed selector. Executes an <a href="#!/api/Ext.ComponentQuery-method-query" rel="Ext.ComponentQuery-method-query" class="docClass">Ext.ComponentQuery.query</a> using this container as its root.</p> <p>Retrieves all descendant components which match the passed function. The function should return false for components that are to be excluded from the selection.</p> <p>Finds a component at any level under this container matching the id/itemId. This is a shorthand for calling ct.down('#' + id);</p> <p>Called by Component#doAutoRender</p> <p>Register a Container configured <code>floating: true</code> with this Component's <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a>.</p> <p>Components added in ths way will not participate in any layout, but will be rendered upon first show in the way that <a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Window</a>s are.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes a component from this container. Fires the <a href="#!/api/Ext.container.AbstractContainer-event-beforeremove" rel="Ext.container.AbstractContainer-event-beforeremove" class="docClass">beforeremove</a> event before removing, then fires the <a href="#!/api/Ext.container.AbstractContainer-event-remove" rel="Ext.container.AbstractContainer-event-remove" class="docClass">remove</a> event after the component has been removed.</p> <p>Removes all components from this container.</p> <p>Removes items in the childEls array based on the return value of a supplied test function. The function is called with a entry in childEls and if the test function return true, that entry is removed. If false, that entry is kept.</p> <p>Removes a CSS class from the top level element representing this component.</p> <p>Removes a cls to the uiCls array, which will also call <a href="#!/api/Ext.AbstractComponent-method-removeUIClsFromElement" rel="Ext.AbstractComponent-method-removeUIClsFromElement" class="docClass">removeUIClsFromElement</a> and removes it from all elements of this component.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Method which removes a specified UI + uiCls from the components element. The cls which is added to the element will be: <code>this.baseCls + '-' + ui</code></p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Conditionally saves a single property from this object to the given state object. The idea is to only save state which has changed from the initial state so that current software settings do not override future software settings. Only those values that are user-changed state should be saved.</p> <p>Scrolls this Component's target element by the passed delta values, optionally animating.</p> <p>All of the following are equivalent:</p> <pre><code> comp.scrollBy(10, 10, true); comp.scrollBy([10, 10], true); comp.scrollBy({ x: 10, y: 10 }, true); </code></pre> <p>Ensures that all effects queued after sequenceFx is called on this object are run in sequence. This is the opposite of <a href="#!/api/Ext.util.Animate-method-syncFx" rel="Ext.util.Animate-method-syncFx" class="docClass">syncFx</a>.</p> <p>This method is called internally by <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">Ext.ZIndexManager</a> to signal that a floating Component has either been moved to the top of its zIndex stack, or pushed from the top of its zIndex stack.</p> <p>If a <em>Window</em> is superceded by another Window, deactivating it hides its shadow.</p> <p>This method also fires the <a href="#!/api/Ext.Component-event-activate" rel="Ext.Component-event-activate" class="docClass">activate</a> or <a href="#!/api/Ext.Component-event-deactivate" rel="Ext.Component-event-deactivate" class="docClass">deactivate</a> event depending on which action occurred.</p> <p>Sets the overflow on the content element of the component.</p> <p>Enable or disable the component.</p> <p>Sets the dock position of this component in its parent panel. Note that this only has effect if this item is part of the dockedItems collection of a parent that has a DockLayout (note that any Panel has a DockLayout by default)</p> <p>Sets the height of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>This method allows you to show or hide a LoadMask on top of this component.</p> <p>Sets the overflow x/y on the content element of the component. The x/y overflow values can be any valid CSS overflow (e.g., 'auto' or 'scroll'). By default, the value is 'hidden'. Passing null for one of the values will erase the inline style. Passing <code>undefined</code> will preserve the current value.</p> <p>Sets the page XY position of the component. To set the left and top instead, use <a href="#!/api/Ext.Component-method-setPosition" rel="Ext.Component-method-setPosition" class="docClass">setPosition</a>. This method fires the <a href="#!/api/Ext.Component-event-move" rel="Ext.Component-event-move" class="docClass">move</a> event.</p> <p>Sets the left and top of the component. To set the page XY position instead, use setPagePosition. This method fires the <a href="#!/api/Ext.AbstractComponent-event-move" rel="Ext.AbstractComponent-event-move" class="docClass">move</a> event.</p> <p>Sets the width and height of this Component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event. This method can accept either width and height as separate arguments, or you can pass a size object like <code>{width:10, height:20}</code>.</p> <p>Sets the UI for the component. This will remove any existing UIs on the component. It will also loop through any uiCls set on the component and rename them so they include the new UI</p> <p>Convenience function to hide or show this component by boolean.</p> <p>Sets the width of the component. This method fires the <a href="#!/api/Ext.AbstractComponent-event-resize" rel="Ext.AbstractComponent-event-resize" class="docClass">resize</a> event.</p> <p>Shows this Component, rendering it first if <a href="#!/api/Ext.Component-cfg-autoRender" rel="Ext.Component-cfg-autoRender" class="docClass">autoRender</a> or <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> are <code>true</code>.</p> <p>After being shown, a <a href="#!/api/Ext.Component-cfg-floating" rel="Ext.Component-cfg-floating" class="docClass">floating</a> Component (such as a <a href="#!/api/Ext.window.Window" rel="Ext.window.Window" class="docClass">Ext.window.Window</a>), is activated it and brought to the front of its <a href="#!/api/Ext.Component-property-zIndexManager" rel="Ext.Component-property-zIndexManager" class="docClass">z-index stack</a>.</p> <p>Displays component at specific xy position. A floating component (like a menu) is positioned relative to its ownerCt if any. Useful for popping up a context menu:</p> <pre><code>listeners: { itemcontextmenu: function(view, record, item, index, event, options) { <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.menu.Menu" rel="Ext.menu.Menu" class="docClass">Ext.menu.Menu</a>', { width: 100, height: 100, margin: '0 0 10 0', items: [{ text: 'regular item 1' },{ text: 'regular item 2' },{ text: 'regular item 3' }] }).showAt(event.getXY()); } } </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Stops any running effects and clears this object's internal effects queue if it contains any additional effects that haven't started yet.</p> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Ensures that all effects queued after syncFx is called on this object are run concurrently. This is the opposite of <a href="#!/api/Ext.util.Animate-method-sequenceFx" rel="Ext.util.Animate-method-sequenceFx" class="docClass">sequenceFx</a>.</p> <p>Sends this Component to the back of (lower z-index than) any other visible windows</p> <p>Brings this floating Component to the front of any other visible, floating Components managed by the same <a href="#!/api/Ext.ZIndexManager" rel="Ext.ZIndexManager" class="docClass">ZIndexManager</a></p> <p>If this Component is modal, inserts the modal mask just below this Component in the z-index stack.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Walks up the <code>ownerCt</code> axis looking for an ancestor Container which matches the passed simple selector.</p> <p>Example:</p> <pre><code>var owningTabPanel = grid.up('tabpanel'); </code></pre> <p>Update the content area of a component.</p> <p>Sets the current box measurements of the component's underlying element.</p> <p>Updates this component's layout. If this update effects this components <a href="#!/api/Ext.AbstractComponent-property-ownerCt" rel="Ext.AbstractComponent-property-ownerCt" class="docClass">ownerCt</a>, that component's <code>updateLayout</code> method will be called to perform the layout instead. Otherwise, just this component (and its child items) will layout.</p> <p>Sets the updating behavior based on batch synchronization. 'operation' (the default) will update the Store's internal representation of the data after each operation of the batch has completed, 'complete' will wait until the entire batch has been completed before updating the Store's data. 'complete' is a good choice for local storage proxies, 'operation' is better for remote proxies, where there is a comparatively high latency.</p> <p>The string type of the Proxy to create if none is specified. This defaults to creating a <a href="#!/api/Ext.data.proxy.Memory" rel="Ext.data.proxy.Memory" class="docClass">memory proxy</a>.</p> <p>The default sort direction to use if one is not specified.</p> <p>If true, any filters attached to this Store will be run after loading data, before the datachanged event is fired. Defaults to true, ignored if <a href="#!/api/Ext.data.Store-cfg-remoteFilter" rel="Ext.data.Store-cfg-remoteFilter" class="docClass">remoteFilter</a> is true</p> <p>The collection of <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Filters</a> currently applied to this Store</p> <p>True if the Store has already been destroyed. If this is true, the reference to Store should be deleted as it will not function correctly any more.</p> <p>Flag denoting that this object is sortable. Always true.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>If true, any sorters attached to this Store will be run after loading data, before the datachanged event is fired. Defaults to true, igored if <a href="#!/api/Ext.data.Store-cfg-remoteSort" rel="Ext.data.Store-cfg-remoteSort" class="docClass">remoteSort</a> is true</p> <p>The property in each item that contains the data to sort.</p> <p>The collection of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Sorters</a> currently applied to this Store</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Returns a comparator function which compares two items and returns -1, 0, or 1 depending on the currently defined set of <a href="#!/api/Ext.util.Sortable-property-sorters" rel="Ext.util.Sortable-property-sorters" class="docClass">sorters</a>.</p> <p>If there are no <a href="#!/api/Ext.util.Sortable-property-sorters" rel="Ext.util.Sortable-property-sorters" class="docClass">sorters</a> defined, it returns a function which returns <code>0</code> meaning that no sorting will occur.</p> <p>Gets all <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">records</a> added or updated since the last commit. Note that the order of records returned is not deterministic and does not indicate the order in which records were modified. Note also that removed records are not included (use <a href="#!/api/Ext.data.AbstractStore-method-getRemovedRecords" rel="Ext.data.AbstractStore-method-getRemovedRecords" class="docClass">getRemovedRecords</a> for that).</p> <p>Returns all Model instances that are either currently a phantom (e.g. have no id), or have an ID but have not yet been saved on this Store (this happens when adding a non-phantom record from another Store into this one)</p> <p>Returns the proxy currently attached to this proxy instance</p> <p>Returns any records that have been removed from the store but not yet destroyed on the proxy.</p> <p>Returns all Model instances that have been updated in the Store but not yet synchronized with the Proxy</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Performs initialization of this mixin. Component classes using this mixin should call this method during their own initialization.</p> <p>Returns true if the Store is currently performing a load operation</p> <p>Loads the Store using its configured <a href="#!/api/Ext.data.AbstractStore-cfg-proxy" rel="Ext.data.AbstractStore-cfg-proxy" class="docClass">proxy</a>.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes all records from the store. This method does a "fast remove", individual remove events are not called. The <a href="#!/api/Ext.data.AbstractStore-event-clear" rel="Ext.data.AbstractStore-event-clear" class="docClass">clear</a> event is fired upon completion.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes automatically syncing the Store with its Proxy. Only applicable if <a href="#!/api/Ext.data.AbstractStore-cfg-autoSync" rel="Ext.data.AbstractStore-cfg-autoSync" class="docClass">autoSync</a> is <code>true</code></p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Saves all pending changes via the configured <a href="#!/api/Ext.data.AbstractStore-cfg-proxy" rel="Ext.data.AbstractStore-cfg-proxy" class="docClass">proxy</a>. Use <a href="#!/api/Ext.data.AbstractStore-method-sync" rel="Ext.data.AbstractStore-method-sync" class="docClass">sync</a> instead.</p> <p>Sets the Store's Proxy by string, config object or Proxy instance</p> <p>Sorts the data in the Store by one or more of its properties. Example usage:</p> <pre><code>//sort by a single field myStore.sort('myField', 'DESC'); //sorting by multiple fields myStore.sort([ { property : 'age', direction: 'ASC' }, { property : 'name', direction: 'DESC' } ]); </code></pre> <p>Internally, Store converts the passed arguments into an array of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Ext.util.Sorter</a> instances, and delegates the actual sorting to its internal <a href="#!/api/Ext.util.MixedCollection" rel="Ext.util.MixedCollection" class="docClass">Ext.util.MixedCollection</a>.</p> <p>When passing a single string argument to sort, Store maintains a ASC/DESC toggler per field, so this code:</p> <pre><code>store.sort('myField'); store.sort('myField'); </code></pre> <p>Is equivalent to this code, because Store handles the toggling automatically:</p> <pre><code>store.sort('myField', 'ASC'); store.sort('myField', 'DESC'); </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends automatically syncing the Store with its Proxy. Only applicable if <a href="#!/api/Ext.data.AbstractStore-cfg-autoSync" rel="Ext.data.AbstractStore-cfg-autoSync" class="docClass">autoSync</a> is <code>true</code></p> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Synchronizes the store with its <a href="#!/api/Ext.data.AbstractStore-cfg-proxy" rel="Ext.data.AbstractStore-cfg-proxy" class="docClass">proxy</a>. This asks the proxy to batch together any new, updated and deleted records in the store, updating the store's internal representation of the records as each operation completes.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Creates the store.</p> <p>Config object</p> <p>Sets the updating behavior based on batch synchronization. 'operation' (the default) will update the Store's internal representation of the data after each operation of the batch has completed, 'complete' will wait until the entire batch has been completed before updating the Store's data. 'complete' is a good choice for local storage proxies, 'operation' is better for remote proxies, where there is a comparatively high latency.</p> <p>The page that the Store has most recently loaded (see <a href="#!/api/Ext.data.Store-method-loadPage" rel="Ext.data.Store-method-loadPage" class="docClass">loadPage</a>)</p> <p>The MixedCollection that holds this store's local cache of records</p> <p>The string type of the Proxy to create if none is specified. This defaults to creating a <a href="#!/api/Ext.data.proxy.Memory" rel="Ext.data.proxy.Memory" class="docClass">memory proxy</a>.</p> <p>The default sort direction to use if one is not specified.</p> <p>If true, any filters attached to this Store will be run after loading data, before the datachanged event is fired. Defaults to true, ignored if <a href="#!/api/Ext.data.Store-cfg-remoteFilter" rel="Ext.data.Store-cfg-remoteFilter" class="docClass">remoteFilter</a> is true</p> <p>The collection of <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Filters</a> currently applied to this Store</p> <p>The collection of <a href="#!/api/Ext.util.Grouper" rel="Ext.util.Grouper" class="docClass">Groupers</a> currently applied to this Store</p> <p>True if the Store has already been destroyed. If this is true, the reference to Store should be deleted as it will not function correctly any more.</p> <p>Flag denoting that this object is sortable. Always true.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>A pristine (unfiltered) collection of the records in this store. This is used to reinstate records when a filter is removed or changed</p> <p>If true, any sorters attached to this Store will be run after loading data, before the datachanged event is fired. Defaults to true, igored if <a href="#!/api/Ext.data.Store-cfg-remoteSort" rel="Ext.data.Store-cfg-remoteSort" class="docClass">remoteSort</a> is true</p> <p>The property in each item that contains the data to sort.</p> <p>The collection of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Sorters</a> currently applied to this Store</p> <p>Adds Model instance to the Store. This method accepts either:</p> <ul> <li>An array of Model instances or Model configuration objects.</li> <li>Any number of Model instance or Model configuration object arguments.</li> </ul> <p>The new Model instances will be added at the end of the existing collection.</p> <p>Sample usage:</p> <pre><code>myStore.add({some: 'data'}, {some: 'other data'}); </code></pre> <p>Note that if this Store is sorted, the new Model instances will be inserted at the correct point in the Store to maintain the sort order.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>(Local sort only) Inserts the passed Record into the Store at the index where it should go based on the current sort information.</p> <p>Runs the aggregate function for all the records in the store.</p> <p>Gets the average value in the store.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Revert to a view of the Record cache with no filtering applied.</p> <p>Clear any groupers in the store</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Collects unique values for a particular dataIndex from this store.</p> <p>Commit all Records with <a href="#!/api/Ext.data.Store-method-getModifiedRecords" rel="Ext.data.Store-method-getModifiedRecords" class="docClass">outstanding changes</a>. To handle updates for changes, subscribe to the Store's <a href="#!/api/Ext.data.Store-event-update" rel="Ext.data.Store-event-update" class="docClass">update event</a>, and perform updating when the third parameter is Ext.data.Record.COMMIT.</p> <p>Gets the count of items in the store.</p> <p>Calls the specified function for each of the <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Records</a> in the cache.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Filters the loaded set of records by a given set of filters.</p> <p>Filtering by single field:</p> <pre><code>store.filter("email", /\.com$/); </code></pre> <p>Using multiple filters:</p> <pre><code>store.filter([ {property: "email", value: /\.com$/}, {filterFn: function(item) { return item.get("age") &gt; 10; }} ]); </code></pre> <p>Using <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a> instances instead of config objects (note that we need to specify the <a href="#!/api/Ext.util.Filter-cfg-root" rel="Ext.util.Filter-cfg-root" class="docClass">root</a> config option in this case):</p> <pre><code>store.filter([ <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a>', {property: "email", value: /\.com$/, root: 'data'}), <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a>', {filterFn: function(item) { return item.get("age") &gt; 10; }, root: 'data'}) ]); </code></pre> <p>Filter by a function. The specified function will be called for each Record in this Store. If the function returns <tt>true</tt> the Record is included, otherwise it is filtered out.</p> <p>Finds the index of the first matching Record in this store by a specific field value.</p> <p>Find the index of the first matching Record in this Store by a function. If the function returns <tt>true</tt> it is considered a match.</p> <p>Finds the index of the first matching Record in this store by a specific field value.</p> <p>Finds the first matching Record in this store by a specific field value.</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Convenience function for getting the first model instance in the store</p> <p>Returns a comparator function which compares two items and returns -1, 0, or 1 depending on the currently defined set of <a href="#!/api/Ext.util.Sortable-property-sorters" rel="Ext.util.Sortable-property-sorters" class="docClass">sorters</a>.</p> <p>If there are no <a href="#!/api/Ext.util.Sortable-property-sorters" rel="Ext.util.Sortable-property-sorters" class="docClass">sorters</a> defined, it returns a function which returns <code>0</code> meaning that no sorting will occur.</p> <p>Get the Record at the specified index.</p> <p>Get the Record with the specified id.</p> <p>Gets the number of cached records.</p> <p>If using paging, this may not be the total size of the dataset. If the data object used by the Reader contains the dataset size, then the <a href="#!/api/Ext.data.Store-method-getTotalCount" rel="Ext.data.Store-method-getTotalCount" class="docClass">getTotalCount</a> function returns the dataset size. <b>Note</b>: see the Important note in <a href="#!/api/Ext.data.Store-method-load" rel="Ext.data.Store-method-load" class="docClass">load</a>.</p> <p>Returns the string to group on for a given model instance. The default implementation of this method returns the model's <a href="#!/api/Ext.data.Store-cfg-groupField" rel="Ext.data.Store-cfg-groupField" class="docClass">groupField</a>, but this can be overridden to group by an arbitrary string. For example, to group by the first letter of a model's 'name' field, use the following code:</p> <pre><code> <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>', { groupDir: 'ASC', getGroupString: function(instance) { return instance.get('name')[0]; } }); </code></pre> <p>Returns an array containing the result of applying grouping to the records in this store. See <a href="#!/api/Ext.data.Store-cfg-groupField" rel="Ext.data.Store-cfg-groupField" class="docClass">groupField</a>, <a href="#!/api/Ext.data.Store-cfg-groupDir" rel="Ext.data.Store-cfg-groupDir" class="docClass">groupDir</a> and <a href="#!/api/Ext.data.Store-method-getGroupString" rel="Ext.data.Store-method-getGroupString" class="docClass">getGroupString</a>. Example for a store containing records with a color field:</p> <pre><code> var myStore = <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>', { groupField: 'color', groupDir : 'DESC' }); myStore.getGroups(); //returns: [ { name: 'yellow', children: [ //all records where the color field is 'yellow' ] }, { name: 'red', children: [ //all records where the color field is 'red' ] } ] </code></pre> <p>Gets all <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">records</a> added or updated since the last commit. Note that the order of records returned is not deterministic and does not indicate the order in which records were modified. Note also that removed records are not included (use <a href="#!/api/Ext.data.AbstractStore-method-getRemovedRecords" rel="Ext.data.AbstractStore-method-getRemovedRecords" class="docClass">getRemovedRecords</a> for that).</p> <p>Returns all Model instances that are either currently a phantom (e.g. have no id), or have an ID but have not yet been saved on this Store (this happens when adding a non-phantom record from another Store into this one)</p> <p>Determines the page from a record index</p> <p>Returns the proxy currently attached to this proxy instance</p> <p>Returns a range of Records between specified indices.</p> <p>Returns any records that have been removed from the store but not yet destroyed on the proxy.</p> <p>Returns the total number of <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Model</a> instances that the <a href="#!/api/Ext.data.proxy.Proxy" rel="Ext.data.proxy.Proxy" class="docClass">Proxy</a> indicates exist. This will usually differ from <a href="#!/api/Ext.data.Store-method-getCount" rel="Ext.data.Store-method-getCount" class="docClass">getCount</a> when using paging - getCount returns the number of records loaded into the Store at the moment, getTotalCount returns the number of records that could be loaded into the Store if the Store contained all data</p> <p>Returns all Model instances that have been updated in the Store but not yet synchronized with the Proxy</p> <p>Group data in the store</p> <p>Guarantee a specific range, this will load the store with a range (that must be the pageSize or smaller) and take care of any loading that may be necessary.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Returns the number of pending requests out.</p> <p>Get the index within the cache of the passed Record.</p> <p>Get the index within the cache of the Record with the passed id.</p> <p>Get the index within the entire dataset. From 0 to the totalCount.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Performs initialization of this mixin. Component classes using this mixin should call this method during their own initialization.</p> <p>Inserts Model instances into the Store at the given index and fires the <a href="#!/api/Ext.data.Store-event-add" rel="Ext.data.Store-event-add" class="docClass">add</a> event. See also <code><a href="#!/api/Ext.data.Store-method-add" rel="Ext.data.Store-method-add" class="docClass">add</a></code>.</p> <p>Returns true if this store is currently filtered</p> <p>Checks if the store is currently grouped</p> <p>Returns true if the Store is currently performing a load operation</p> <p>Convenience function for getting the last model instance in the store</p> <p>Loads data into the Store via the configured <a href="#!/api/Ext.data.Store-cfg-proxy" rel="Ext.data.Store-cfg-proxy" class="docClass">proxy</a>. This uses the Proxy to make an asynchronous call to whatever storage backend the Proxy uses, automatically adding the retrieved instances into the Store and calling an optional callback if required. Example usage:</p> <pre><code>store.load({ scope: this, callback: function(records, operation, success) { // the <a href="#!/api/Ext.data.Operation" rel="Ext.data.Operation" class="docClass">operation</a> object // contains all of the details of the load operation console.log(records); } }); </code></pre> <p>If the callback scope does not need to be set, a function can simply be passed:</p> <pre><code>store.load(function(records, operation, success) { console.log('loaded records'); }); </code></pre> <p>Loads an array of data straight into the Store.</p> <p>Using this method is great if the data is in the correct format already (e.g. it doesn't need to be processed by a reader). If your data requires processing to decode the data structure, use a <a href="#!/api/Ext.data.proxy.Memory" rel="Ext.data.proxy.Memory" class="docClass">MemoryProxy</a> instead.</p> <p>Loads a given 'page' of data by setting the start and limit values appropriately. Internally this just causes a normal load operation, passing in calculated 'start' and 'limit' params</p> <p>Loads data via the bound Proxy's reader</p> <p>Use this method if you are attempting to load data and want to utilize the configured data reader.</p> <p>Loads an array of <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">model</a> instances into the store, fires the datachanged event. This should only usually be called internally when loading from the <a href="#!/api/Ext.data.proxy.Proxy" rel="Ext.data.proxy.Proxy" class="docClass">Proxy</a>, when adding records manually use <a href="#!/api/Ext.data.Store-method-add" rel="Ext.data.Store-method-add" class="docClass">add</a> instead</p> <p>Gets the maximum value in the store.</p> <p>Gets the minimum value in the store.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Loads the next 'page' in the current data set</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Prefetches data into the store using its configured <a href="#!/api/Ext.data.Store-cfg-proxy" rel="Ext.data.Store-cfg-proxy" class="docClass">proxy</a>.</p> <p>Prefetches a page of data.</p> <p>Loads the previous 'page' in the current data set</p> <p>Purge the least recently used records in the prefetch if the purgeCount has been exceeded.</p> <p>Query the cached records in this Store using a filtering function. The specified function will be called with each record in this Store. If the function returns <tt>true</tt> the record is included in the results.</p> <p><a href="#!/api/Ext.data.Model-method-reject" rel="Ext.data.Model-method-reject" class="docClass">Reject</a> outstanding changes on all <a href="#!/api/Ext.data.Store-method-getModifiedRecords" rel="Ext.data.Store-method-getModifiedRecords" class="docClass">modified records</a> and re-insert any records that were removed locally. Any phantom records will be removed.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes the given record from the Store, firing the 'remove' event for each instance that is removed, plus a single 'datachanged' event after removal.</p> <p>Remove all items from the store.</p> <p>Removes the model instance at the given index</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes automatically syncing the Store with its Proxy. Only applicable if <a href="#!/api/Ext.data.AbstractStore-cfg-autoSync" rel="Ext.data.AbstractStore-cfg-autoSync" class="docClass">autoSync</a> is <code>true</code></p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Saves all pending changes via the configured <a href="#!/api/Ext.data.AbstractStore-cfg-proxy" rel="Ext.data.AbstractStore-cfg-proxy" class="docClass">proxy</a>. Use <a href="#!/api/Ext.data.AbstractStore-method-sync" rel="Ext.data.AbstractStore-method-sync" class="docClass">sync</a> instead.</p> <p>Sets the Store's Proxy by string, config object or Proxy instance</p> <p>Sorts the data in the Store by one or more of its properties. Example usage:</p> <pre><code>//sort by a single field myStore.sort('myField', 'DESC'); //sorting by multiple fields myStore.sort([ { property : 'age', direction: 'ASC' }, { property : 'name', direction: 'DESC' } ]); </code></pre> <p>Internally, Store converts the passed arguments into an array of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Ext.util.Sorter</a> instances, and delegates the actual sorting to its internal <a href="#!/api/Ext.util.MixedCollection" rel="Ext.util.MixedCollection" class="docClass">Ext.util.MixedCollection</a>.</p> <p>When passing a single string argument to sort, Store maintains a ASC/DESC toggler per field, so this code:</p> <pre><code>store.sort('myField'); store.sort('myField'); </code></pre> <p>Is equivalent to this code, because Store handles the toggling automatically:</p> <pre><code>store.sort('myField', 'ASC'); store.sort('myField', 'DESC'); </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Sums the value of <tt>property</tt> for each <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">record</a> between <tt>start</tt> and <tt>end</tt> and returns the result.</p> <p>Suspends automatically syncing the Store with its Proxy. Only applicable if <a href="#!/api/Ext.data.AbstractStore-cfg-autoSync" rel="Ext.data.AbstractStore-cfg-autoSync" class="docClass">autoSync</a> is <code>true</code></p> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Synchronizes the store with its <a href="#!/api/Ext.data.AbstractStore-cfg-proxy" rel="Ext.data.AbstractStore-cfg-proxy" class="docClass">proxy</a>. This asks the proxy to batch together any new, updated and deleted records in the store, updating the store's internal representation of the records as each operation completes.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Creates the Association object.</p> <p>Config object.</p> <p>The name of the model is on the other end of the association (e.g. if a User model hasMany Orders, this is 'Order')</p> <p>The name of the model that 'owns' the association</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Get a specialized reader for reading associated data</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Creates the Association object.</p> <p>Config object.</p> <p>The name of the model is on the other end of the association (e.g. if a User model hasMany Orders, this is 'Order')</p> <p>The name of the model that 'owns' the association</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Get a specialized reader for reading associated data</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Creates the Association object.</p> <p>Config object.</p> <p>The name of the model is on the other end of the association (e.g. if a User model hasMany Orders, this is 'Order')</p> <p>The name of the model that 'owns' the association</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Get a specialized reader for reading associated data</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Creates the Association object.</p> <p>Config object.</p> <p>The name of the model is on the other end of the association (e.g. if a User model hasMany Orders, this is 'Order')</p> <p>The name of the model that 'owns' the association</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Get a specialized reader for reading associated data</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Creates new Batch object.</p> <p>Config object</p> <p>The index of the current operation being executed. Read only</p> <p>Ordered array of operations that raised an exception during the most recent batch execution and did not successfully complete</p> <p>True if this batch has encountered an exception. This is cleared at the start of each operation. Read only</p> <p>True if this batch has been executed completely. Read only</p> <p>True if the batch is currently running. Read only</p> <p>Ordered array of operations that will be executed by this batch</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>The total number of operations in this batch. Read only</p> <p>Adds a new operation to this batch at the end of the <a href="#!/api/Ext.data.Batch-property-operations" rel="Ext.data.Batch-property-operations" class="docClass">operations</a> array</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Pauses execution of the batch, but does not cancel the current operation</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Kicks off execution of the batch, continuing from the current operation. This is intended for restarting a <a href="#!/api/Ext.data.Batch-method-pause" rel="Ext.data.Batch-method-pause" class="docClass">paused</a> batch after an exception, and the operation that raised the exception will now be retried. The batch will then continue with its normal processing until all operations are complete or another exception is encountered.</p> <p>Note that if the batch is already running any call to retry will be ignored.</p> <p>Executes an operation by its numeric index in the <a href="#!/api/Ext.data.Batch-property-operations" rel="Ext.data.Batch-property-operations" class="docClass">operations</a> array</p> <p>Kicks off execution of the batch, continuing from the next operation if the previous operation encountered an exception, or if execution was paused. Use this method to start the batch for the first time or to restart a paused batch by skipping the current unsuccessful operation.</p> <p>To retry processing the current operation before continuing to the rest of the batch (e.g. because you explicitly handled the operation's exception), call <a href="#!/api/Ext.data.Batch-method-retry" rel="Ext.data.Batch-method-retry" class="docClass">retry</a> instead.</p> <p>Note that if the batch is already running any call to start will be ignored.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Creates the store.</p> <p>Config object</p> <p>Sets the updating behavior based on batch synchronization. 'operation' (the default) will update the Store's internal representation of the data after each operation of the batch has completed, 'complete' will wait until the entire batch has been completed before updating the Store's data. 'complete' is a good choice for local storage proxies, 'operation' is better for remote proxies, where there is a comparatively high latency.</p> <p>The page that the Store has most recently loaded (see <a href="#!/api/Ext.data.Store-method-loadPage" rel="Ext.data.Store-method-loadPage" class="docClass">loadPage</a>)</p> <p>The MixedCollection that holds this store's local cache of records</p> <p>The string type of the Proxy to create if none is specified. This defaults to creating a <a href="#!/api/Ext.data.proxy.Memory" rel="Ext.data.proxy.Memory" class="docClass">memory proxy</a>.</p> <p>The default sort direction to use if one is not specified.</p> <p>If true, any filters attached to this Store will be run after loading data, before the datachanged event is fired. Defaults to true, ignored if <a href="#!/api/Ext.data.Store-cfg-remoteFilter" rel="Ext.data.Store-cfg-remoteFilter" class="docClass">remoteFilter</a> is true</p> <p>The collection of <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Filters</a> currently applied to this Store</p> <p>The collection of <a href="#!/api/Ext.util.Grouper" rel="Ext.util.Grouper" class="docClass">Groupers</a> currently applied to this Store</p> <p>True if the Store has already been destroyed. If this is true, the reference to Store should be deleted as it will not function correctly any more.</p> <p>Flag denoting that this object is sortable. Always true.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>A pristine (unfiltered) collection of the records in this store. This is used to reinstate records when a filter is removed or changed</p> <p>If true, any sorters attached to this Store will be run after loading data, before the datachanged event is fired. Defaults to true, igored if <a href="#!/api/Ext.data.Store-cfg-remoteSort" rel="Ext.data.Store-cfg-remoteSort" class="docClass">remoteSort</a> is true</p> <p>The property in each item that contains the data to sort.</p> <p>The collection of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Sorters</a> currently applied to this Store</p> <p>Adds Model instance to the Store. This method accepts either:</p> <ul> <li>An array of Model instances or Model configuration objects.</li> <li>Any number of Model instance or Model configuration object arguments.</li> </ul> <p>The new Model instances will be added at the end of the existing collection.</p> <p>Sample usage:</p> <pre><code>myStore.add({some: 'data'}, {some: 'other data'}); </code></pre> <p>Note that if this Store is sorted, the new Model instances will be inserted at the correct point in the Store to maintain the sort order.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>(Local sort only) Inserts the passed Record into the Store at the index where it should go based on the current sort information.</p> <p>Runs the aggregate function for all the records in the store.</p> <p>Gets the average value in the store.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Revert to a view of the Record cache with no filtering applied.</p> <p>Clear any groupers in the store</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Collects unique values for a particular dataIndex from this store.</p> <p>Commit all Records with <a href="#!/api/Ext.data.Store-method-getModifiedRecords" rel="Ext.data.Store-method-getModifiedRecords" class="docClass">outstanding changes</a>. To handle updates for changes, subscribe to the Store's <a href="#!/api/Ext.data.Store-event-update" rel="Ext.data.Store-event-update" class="docClass">update event</a>, and perform updating when the third parameter is Ext.data.Record.COMMIT.</p> <p>Gets the count of items in the store.</p> <p>Calls the specified function for each of the <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Records</a> in the cache.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Filters the loaded set of records by a given set of filters.</p> <p>Filtering by single field:</p> <pre><code>store.filter("email", /\.com$/); </code></pre> <p>Using multiple filters:</p> <pre><code>store.filter([ {property: "email", value: /\.com$/}, {filterFn: function(item) { return item.get("age") &gt; 10; }} ]); </code></pre> <p>Using <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a> instances instead of config objects (note that we need to specify the <a href="#!/api/Ext.util.Filter-cfg-root" rel="Ext.util.Filter-cfg-root" class="docClass">root</a> config option in this case):</p> <pre><code>store.filter([ <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a>', {property: "email", value: /\.com$/, root: 'data'}), <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a>', {filterFn: function(item) { return item.get("age") &gt; 10; }, root: 'data'}) ]); </code></pre> <p>Filter by a function. The specified function will be called for each Record in this Store. If the function returns <tt>true</tt> the Record is included, otherwise it is filtered out.</p> <p>Finds the index of the first matching Record in this store by a specific field value.</p> <p>Find the index of the first matching Record in this Store by a function. If the function returns <tt>true</tt> it is considered a match.</p> <p>Finds the index of the first matching Record in this store by a specific field value.</p> <p>Finds the first matching Record in this store by a specific field value.</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Convenience function for getting the first model instance in the store</p> <p>Returns a comparator function which compares two items and returns -1, 0, or 1 depending on the currently defined set of <a href="#!/api/Ext.util.Sortable-property-sorters" rel="Ext.util.Sortable-property-sorters" class="docClass">sorters</a>.</p> <p>If there are no <a href="#!/api/Ext.util.Sortable-property-sorters" rel="Ext.util.Sortable-property-sorters" class="docClass">sorters</a> defined, it returns a function which returns <code>0</code> meaning that no sorting will occur.</p> <p>Get the Record at the specified index.</p> <p>Get the Record with the specified id.</p> <p>Gets the number of cached records.</p> <p>If using paging, this may not be the total size of the dataset. If the data object used by the Reader contains the dataset size, then the <a href="#!/api/Ext.data.Store-method-getTotalCount" rel="Ext.data.Store-method-getTotalCount" class="docClass">getTotalCount</a> function returns the dataset size. <b>Note</b>: see the Important note in <a href="#!/api/Ext.data.Store-method-load" rel="Ext.data.Store-method-load" class="docClass">load</a>.</p> <p>Returns the string to group on for a given model instance. The default implementation of this method returns the model's <a href="#!/api/Ext.data.Store-cfg-groupField" rel="Ext.data.Store-cfg-groupField" class="docClass">groupField</a>, but this can be overridden to group by an arbitrary string. For example, to group by the first letter of a model's 'name' field, use the following code:</p> <pre><code> <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>', { groupDir: 'ASC', getGroupString: function(instance) { return instance.get('name')[0]; } }); </code></pre> <p>Returns an array containing the result of applying grouping to the records in this store. See <a href="#!/api/Ext.data.Store-cfg-groupField" rel="Ext.data.Store-cfg-groupField" class="docClass">groupField</a>, <a href="#!/api/Ext.data.Store-cfg-groupDir" rel="Ext.data.Store-cfg-groupDir" class="docClass">groupDir</a> and <a href="#!/api/Ext.data.Store-method-getGroupString" rel="Ext.data.Store-method-getGroupString" class="docClass">getGroupString</a>. Example for a store containing records with a color field:</p> <pre><code> var myStore = <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>', { groupField: 'color', groupDir : 'DESC' }); myStore.getGroups(); //returns: [ { name: 'yellow', children: [ //all records where the color field is 'yellow' ] }, { name: 'red', children: [ //all records where the color field is 'red' ] } ] </code></pre> <p>Gets all <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">records</a> added or updated since the last commit. Note that the order of records returned is not deterministic and does not indicate the order in which records were modified. Note also that removed records are not included (use <a href="#!/api/Ext.data.AbstractStore-method-getRemovedRecords" rel="Ext.data.AbstractStore-method-getRemovedRecords" class="docClass">getRemovedRecords</a> for that).</p> <p>Returns all Model instances that are either currently a phantom (e.g. have no id), or have an ID but have not yet been saved on this Store (this happens when adding a non-phantom record from another Store into this one)</p> <p>Determines the page from a record index</p> <p>Returns the proxy currently attached to this proxy instance</p> <p>Returns a range of Records between specified indices.</p> <p>Returns any records that have been removed from the store but not yet destroyed on the proxy.</p> <p>Returns the total number of <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Model</a> instances that the <a href="#!/api/Ext.data.proxy.Proxy" rel="Ext.data.proxy.Proxy" class="docClass">Proxy</a> indicates exist. This will usually differ from <a href="#!/api/Ext.data.Store-method-getCount" rel="Ext.data.Store-method-getCount" class="docClass">getCount</a> when using paging - getCount returns the number of records loaded into the Store at the moment, getTotalCount returns the number of records that could be loaded into the Store if the Store contained all data</p> <p>Returns all Model instances that have been updated in the Store but not yet synchronized with the Proxy</p> <p>Group data in the store</p> <p>Guarantee a specific range, this will load the store with a range (that must be the pageSize or smaller) and take care of any loading that may be necessary.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Returns the number of pending requests out.</p> <p>Get the index within the cache of the passed Record.</p> <p>Get the index within the cache of the Record with the passed id.</p> <p>Get the index within the entire dataset. From 0 to the totalCount.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Performs initialization of this mixin. Component classes using this mixin should call this method during their own initialization.</p> <p>Inserts Model instances into the Store at the given index and fires the <a href="#!/api/Ext.data.Store-event-add" rel="Ext.data.Store-event-add" class="docClass">add</a> event. See also <code><a href="#!/api/Ext.data.Store-method-add" rel="Ext.data.Store-method-add" class="docClass">add</a></code>.</p> <p>Returns true if this store is currently filtered</p> <p>Checks if the store is currently grouped</p> <p>Returns true if the Store is currently performing a load operation</p> <p>Convenience function for getting the last model instance in the store</p> <p>Loads data into the Store via the configured <a href="#!/api/Ext.data.Store-cfg-proxy" rel="Ext.data.Store-cfg-proxy" class="docClass">proxy</a>. This uses the Proxy to make an asynchronous call to whatever storage backend the Proxy uses, automatically adding the retrieved instances into the Store and calling an optional callback if required. Example usage:</p> <pre><code>store.load({ scope: this, callback: function(records, operation, success) { // the <a href="#!/api/Ext.data.Operation" rel="Ext.data.Operation" class="docClass">operation</a> object // contains all of the details of the load operation console.log(records); } }); </code></pre> <p>If the callback scope does not need to be set, a function can simply be passed:</p> <pre><code>store.load(function(records, operation, success) { console.log('loaded records'); }); </code></pre> <p>Loads an array of data straight into the Store.</p> <p>Using this method is great if the data is in the correct format already (e.g. it doesn't need to be processed by a reader). If your data requires processing to decode the data structure, use a <a href="#!/api/Ext.data.proxy.Memory" rel="Ext.data.proxy.Memory" class="docClass">MemoryProxy</a> instead.</p> <p>Loads a given 'page' of data by setting the start and limit values appropriately. Internally this just causes a normal load operation, passing in calculated 'start' and 'limit' params</p> <p>Loads data via the bound Proxy's reader</p> <p>Use this method if you are attempting to load data and want to utilize the configured data reader.</p> <p>Loads an array of <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">model</a> instances into the store, fires the datachanged event. This should only usually be called internally when loading from the <a href="#!/api/Ext.data.proxy.Proxy" rel="Ext.data.proxy.Proxy" class="docClass">Proxy</a>, when adding records manually use <a href="#!/api/Ext.data.Store-method-add" rel="Ext.data.Store-method-add" class="docClass">add</a> instead</p> <p>Gets the maximum value in the store.</p> <p>Gets the minimum value in the store.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Loads the next 'page' in the current data set</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Prefetches data into the store using its configured <a href="#!/api/Ext.data.Store-cfg-proxy" rel="Ext.data.Store-cfg-proxy" class="docClass">proxy</a>.</p> <p>Prefetches a page of data.</p> <p>Loads the previous 'page' in the current data set</p> <p>Purge the least recently used records in the prefetch if the purgeCount has been exceeded.</p> <p>Query the cached records in this Store using a filtering function. The specified function will be called with each record in this Store. If the function returns <tt>true</tt> the record is included in the results.</p> <p><a href="#!/api/Ext.data.Model-method-reject" rel="Ext.data.Model-method-reject" class="docClass">Reject</a> outstanding changes on all <a href="#!/api/Ext.data.Store-method-getModifiedRecords" rel="Ext.data.Store-method-getModifiedRecords" class="docClass">modified records</a> and re-insert any records that were removed locally. Any phantom records will be removed.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes the given record from the Store, firing the 'remove' event for each instance that is removed, plus a single 'datachanged' event after removal.</p> <p>Remove all items from the store.</p> <p>Removes the model instance at the given index</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes automatically syncing the Store with its Proxy. Only applicable if <a href="#!/api/Ext.data.AbstractStore-cfg-autoSync" rel="Ext.data.AbstractStore-cfg-autoSync" class="docClass">autoSync</a> is <code>true</code></p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Saves all pending changes via the configured <a href="#!/api/Ext.data.AbstractStore-cfg-proxy" rel="Ext.data.AbstractStore-cfg-proxy" class="docClass">proxy</a>. Use <a href="#!/api/Ext.data.AbstractStore-method-sync" rel="Ext.data.AbstractStore-method-sync" class="docClass">sync</a> instead.</p> <p>Sets the Store's Proxy by string, config object or Proxy instance</p> <p>Sorts the data in the Store by one or more of its properties. Example usage:</p> <pre><code>//sort by a single field myStore.sort('myField', 'DESC'); //sorting by multiple fields myStore.sort([ { property : 'age', direction: 'ASC' }, { property : 'name', direction: 'DESC' } ]); </code></pre> <p>Internally, Store converts the passed arguments into an array of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Ext.util.Sorter</a> instances, and delegates the actual sorting to its internal <a href="#!/api/Ext.util.MixedCollection" rel="Ext.util.MixedCollection" class="docClass">Ext.util.MixedCollection</a>.</p> <p>When passing a single string argument to sort, Store maintains a ASC/DESC toggler per field, so this code:</p> <pre><code>store.sort('myField'); store.sort('myField'); </code></pre> <p>Is equivalent to this code, because Store handles the toggling automatically:</p> <pre><code>store.sort('myField', 'ASC'); store.sort('myField', 'DESC'); </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Sums the value of <tt>property</tt> for each <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">record</a> between <tt>start</tt> and <tt>end</tt> and returns the result.</p> <p>Suspends automatically syncing the Store with its Proxy. Only applicable if <a href="#!/api/Ext.data.AbstractStore-cfg-autoSync" rel="Ext.data.AbstractStore-cfg-autoSync" class="docClass">autoSync</a> is <code>true</code></p> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Synchronizes the store with its <a href="#!/api/Ext.data.AbstractStore-cfg-proxy" rel="Ext.data.AbstractStore-cfg-proxy" class="docClass">proxy</a>. This asks the proxy to batch together any new, updated and deleted records in the store, updating the store's internal representation of the records as each operation completes.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Aborts an active request.</p> <p>Aborts all active requests</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Determines whether this object has a request outstanding.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Checks if the response status was successful</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Sends an HTTP request to a remote server.</p> <p><strong>Important:</strong> Ajax server requests are asynchronous, and this call will return before the response has been received. Process any returned data in a callback function.</p> <pre><code><a href="#!/api/Ext.Ajax-method-request" rel="Ext.Ajax-method-request" class="docClass">Ext.Ajax.request</a>({ url: 'ajax_demo/sample.json', success: function(response, opts) { var obj = <a href="#!/api/Ext-method-decode" rel="Ext-method-decode" class="docClass">Ext.decode</a>(response.responseText); console.dir(obj); }, failure: function(response, opts) { console.log('server-side failure with status code ' + response.status); } }); </code></pre> <p>To execute a callback function in the correct scope, use the <code>scope</code> option.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Sets various options such as the url, params for the request</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Uploads a form using a hidden iframe.</p> <p>Creates the store.</p> <p>Config object</p> <p>Sets the updating behavior based on batch synchronization. 'operation' (the default) will update the Store's internal representation of the data after each operation of the batch has completed, 'complete' will wait until the entire batch has been completed before updating the Store's data. 'complete' is a good choice for local storage proxies, 'operation' is better for remote proxies, where there is a comparatively high latency.</p> <p>The page that the Store has most recently loaded (see <a href="#!/api/Ext.data.Store-method-loadPage" rel="Ext.data.Store-method-loadPage" class="docClass">loadPage</a>)</p> <p>The MixedCollection that holds this store's local cache of records</p> <p>The string type of the Proxy to create if none is specified. This defaults to creating a <a href="#!/api/Ext.data.proxy.Memory" rel="Ext.data.proxy.Memory" class="docClass">memory proxy</a>.</p> <p>The default sort direction to use if one is not specified.</p> <p>If true, any filters attached to this Store will be run after loading data, before the datachanged event is fired. Defaults to true, ignored if <a href="#!/api/Ext.data.Store-cfg-remoteFilter" rel="Ext.data.Store-cfg-remoteFilter" class="docClass">remoteFilter</a> is true</p> <p>The collection of <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Filters</a> currently applied to this Store</p> <p>The collection of <a href="#!/api/Ext.util.Grouper" rel="Ext.util.Grouper" class="docClass">Groupers</a> currently applied to this Store</p> <p>True if the Store has already been destroyed. If this is true, the reference to Store should be deleted as it will not function correctly any more.</p> <p>Flag denoting that this object is sortable. Always true.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>A pristine (unfiltered) collection of the records in this store. This is used to reinstate records when a filter is removed or changed</p> <p>If true, any sorters attached to this Store will be run after loading data, before the datachanged event is fired. Defaults to true, igored if <a href="#!/api/Ext.data.Store-cfg-remoteSort" rel="Ext.data.Store-cfg-remoteSort" class="docClass">remoteSort</a> is true</p> <p>The property in each item that contains the data to sort.</p> <p>The collection of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Sorters</a> currently applied to this Store</p> <p>Adds Model instance to the Store. This method accepts either:</p> <ul> <li>An array of Model instances or Model configuration objects.</li> <li>Any number of Model instance or Model configuration object arguments.</li> </ul> <p>The new Model instances will be added at the end of the existing collection.</p> <p>Sample usage:</p> <pre><code>myStore.add({some: 'data'}, {some: 'other data'}); </code></pre> <p>Note that if this Store is sorted, the new Model instances will be inserted at the correct point in the Store to maintain the sort order.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>(Local sort only) Inserts the passed Record into the Store at the index where it should go based on the current sort information.</p> <p>Runs the aggregate function for all the records in the store.</p> <p>Gets the average value in the store.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Revert to a view of the Record cache with no filtering applied.</p> <p>Clear any groupers in the store</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Collects unique values for a particular dataIndex from this store.</p> <p>Commit all Records with <a href="#!/api/Ext.data.Store-method-getModifiedRecords" rel="Ext.data.Store-method-getModifiedRecords" class="docClass">outstanding changes</a>. To handle updates for changes, subscribe to the Store's <a href="#!/api/Ext.data.Store-event-update" rel="Ext.data.Store-event-update" class="docClass">update event</a>, and perform updating when the third parameter is Ext.data.Record.COMMIT.</p> <p>Gets the count of items in the store.</p> <p>Calls the specified function for each of the <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Records</a> in the cache.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Filters the loaded set of records by a given set of filters.</p> <p>Filtering by single field:</p> <pre><code>store.filter("email", /\.com$/); </code></pre> <p>Using multiple filters:</p> <pre><code>store.filter([ {property: "email", value: /\.com$/}, {filterFn: function(item) { return item.get("age") &gt; 10; }} ]); </code></pre> <p>Using <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a> instances instead of config objects (note that we need to specify the <a href="#!/api/Ext.util.Filter-cfg-root" rel="Ext.util.Filter-cfg-root" class="docClass">root</a> config option in this case):</p> <pre><code>store.filter([ <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a>', {property: "email", value: /\.com$/, root: 'data'}), <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a>', {filterFn: function(item) { return item.get("age") &gt; 10; }, root: 'data'}) ]); </code></pre> <p>Filter by a function. The specified function will be called for each Record in this Store. If the function returns <tt>true</tt> the Record is included, otherwise it is filtered out.</p> <p>Finds the index of the first matching Record in this store by a specific field value.</p> <p>Find the index of the first matching Record in this Store by a function. If the function returns <tt>true</tt> it is considered a match.</p> <p>Finds the index of the first matching Record in this store by a specific field value.</p> <p>Finds the first matching Record in this store by a specific field value.</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Convenience function for getting the first model instance in the store</p> <p>Returns a comparator function which compares two items and returns -1, 0, or 1 depending on the currently defined set of <a href="#!/api/Ext.util.Sortable-property-sorters" rel="Ext.util.Sortable-property-sorters" class="docClass">sorters</a>.</p> <p>If there are no <a href="#!/api/Ext.util.Sortable-property-sorters" rel="Ext.util.Sortable-property-sorters" class="docClass">sorters</a> defined, it returns a function which returns <code>0</code> meaning that no sorting will occur.</p> <p>Get the Record at the specified index.</p> <p>Get the Record with the specified id.</p> <p>Gets the number of cached records.</p> <p>If using paging, this may not be the total size of the dataset. If the data object used by the Reader contains the dataset size, then the <a href="#!/api/Ext.data.Store-method-getTotalCount" rel="Ext.data.Store-method-getTotalCount" class="docClass">getTotalCount</a> function returns the dataset size. <b>Note</b>: see the Important note in <a href="#!/api/Ext.data.Store-method-load" rel="Ext.data.Store-method-load" class="docClass">load</a>.</p> <p>Returns the string to group on for a given model instance. The default implementation of this method returns the model's <a href="#!/api/Ext.data.Store-cfg-groupField" rel="Ext.data.Store-cfg-groupField" class="docClass">groupField</a>, but this can be overridden to group by an arbitrary string. For example, to group by the first letter of a model's 'name' field, use the following code:</p> <pre><code> <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>', { groupDir: 'ASC', getGroupString: function(instance) { return instance.get('name')[0]; } }); </code></pre> <p>Returns an array containing the result of applying grouping to the records in this store. See <a href="#!/api/Ext.data.Store-cfg-groupField" rel="Ext.data.Store-cfg-groupField" class="docClass">groupField</a>, <a href="#!/api/Ext.data.Store-cfg-groupDir" rel="Ext.data.Store-cfg-groupDir" class="docClass">groupDir</a> and <a href="#!/api/Ext.data.Store-method-getGroupString" rel="Ext.data.Store-method-getGroupString" class="docClass">getGroupString</a>. Example for a store containing records with a color field:</p> <pre><code> var myStore = <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>', { groupField: 'color', groupDir : 'DESC' }); myStore.getGroups(); //returns: [ { name: 'yellow', children: [ //all records where the color field is 'yellow' ] }, { name: 'red', children: [ //all records where the color field is 'red' ] } ] </code></pre> <p>Gets all <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">records</a> added or updated since the last commit. Note that the order of records returned is not deterministic and does not indicate the order in which records were modified. Note also that removed records are not included (use <a href="#!/api/Ext.data.AbstractStore-method-getRemovedRecords" rel="Ext.data.AbstractStore-method-getRemovedRecords" class="docClass">getRemovedRecords</a> for that).</p> <p>Returns all Model instances that are either currently a phantom (e.g. have no id), or have an ID but have not yet been saved on this Store (this happens when adding a non-phantom record from another Store into this one)</p> <p>Determines the page from a record index</p> <p>Returns the proxy currently attached to this proxy instance</p> <p>Returns a range of Records between specified indices.</p> <p>Returns any records that have been removed from the store but not yet destroyed on the proxy.</p> <p>Returns the total number of <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Model</a> instances that the <a href="#!/api/Ext.data.proxy.Proxy" rel="Ext.data.proxy.Proxy" class="docClass">Proxy</a> indicates exist. This will usually differ from <a href="#!/api/Ext.data.Store-method-getCount" rel="Ext.data.Store-method-getCount" class="docClass">getCount</a> when using paging - getCount returns the number of records loaded into the Store at the moment, getTotalCount returns the number of records that could be loaded into the Store if the Store contained all data</p> <p>Returns all Model instances that have been updated in the Store but not yet synchronized with the Proxy</p> <p>Group data in the store</p> <p>Guarantee a specific range, this will load the store with a range (that must be the pageSize or smaller) and take care of any loading that may be necessary.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Returns the number of pending requests out.</p> <p>Get the index within the cache of the passed Record.</p> <p>Get the index within the cache of the Record with the passed id.</p> <p>Get the index within the entire dataset. From 0 to the totalCount.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Performs initialization of this mixin. Component classes using this mixin should call this method during their own initialization.</p> <p>Inserts Model instances into the Store at the given index and fires the <a href="#!/api/Ext.data.Store-event-add" rel="Ext.data.Store-event-add" class="docClass">add</a> event. See also <code><a href="#!/api/Ext.data.Store-method-add" rel="Ext.data.Store-method-add" class="docClass">add</a></code>.</p> <p>Returns true if this store is currently filtered</p> <p>Checks if the store is currently grouped</p> <p>Returns true if the Store is currently performing a load operation</p> <p>Convenience function for getting the last model instance in the store</p> <p>Loads data into the Store via the configured <a href="#!/api/Ext.data.Store-cfg-proxy" rel="Ext.data.Store-cfg-proxy" class="docClass">proxy</a>. This uses the Proxy to make an asynchronous call to whatever storage backend the Proxy uses, automatically adding the retrieved instances into the Store and calling an optional callback if required. Example usage:</p> <pre><code>store.load({ scope: this, callback: function(records, operation, success) { // the <a href="#!/api/Ext.data.Operation" rel="Ext.data.Operation" class="docClass">operation</a> object // contains all of the details of the load operation console.log(records); } }); </code></pre> <p>If the callback scope does not need to be set, a function can simply be passed:</p> <pre><code>store.load(function(records, operation, success) { console.log('loaded records'); }); </code></pre> <p>Loads an array of data straight into the Store.</p> <p>Using this method is great if the data is in the correct format already (e.g. it doesn't need to be processed by a reader). If your data requires processing to decode the data structure, use a <a href="#!/api/Ext.data.proxy.Memory" rel="Ext.data.proxy.Memory" class="docClass">MemoryProxy</a> instead.</p> <p>Loads a given 'page' of data by setting the start and limit values appropriately. Internally this just causes a normal load operation, passing in calculated 'start' and 'limit' params</p> <p>Loads data via the bound Proxy's reader</p> <p>Use this method if you are attempting to load data and want to utilize the configured data reader.</p> <p>Loads an array of <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">model</a> instances into the store, fires the datachanged event. This should only usually be called internally when loading from the <a href="#!/api/Ext.data.proxy.Proxy" rel="Ext.data.proxy.Proxy" class="docClass">Proxy</a>, when adding records manually use <a href="#!/api/Ext.data.Store-method-add" rel="Ext.data.Store-method-add" class="docClass">add</a> instead</p> <p>Gets the maximum value in the store.</p> <p>Gets the minimum value in the store.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Loads the next 'page' in the current data set</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Prefetches data into the store using its configured <a href="#!/api/Ext.data.Store-cfg-proxy" rel="Ext.data.Store-cfg-proxy" class="docClass">proxy</a>.</p> <p>Prefetches a page of data.</p> <p>Loads the previous 'page' in the current data set</p> <p>Purge the least recently used records in the prefetch if the purgeCount has been exceeded.</p> <p>Query the cached records in this Store using a filtering function. The specified function will be called with each record in this Store. If the function returns <tt>true</tt> the record is included in the results.</p> <p><a href="#!/api/Ext.data.Model-method-reject" rel="Ext.data.Model-method-reject" class="docClass">Reject</a> outstanding changes on all <a href="#!/api/Ext.data.Store-method-getModifiedRecords" rel="Ext.data.Store-method-getModifiedRecords" class="docClass">modified records</a> and re-insert any records that were removed locally. Any phantom records will be removed.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes the given record from the Store, firing the 'remove' event for each instance that is removed, plus a single 'datachanged' event after removal.</p> <p>Remove all items from the store.</p> <p>Removes the model instance at the given index</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes automatically syncing the Store with its Proxy. Only applicable if <a href="#!/api/Ext.data.AbstractStore-cfg-autoSync" rel="Ext.data.AbstractStore-cfg-autoSync" class="docClass">autoSync</a> is <code>true</code></p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Saves all pending changes via the configured <a href="#!/api/Ext.data.AbstractStore-cfg-proxy" rel="Ext.data.AbstractStore-cfg-proxy" class="docClass">proxy</a>. Use <a href="#!/api/Ext.data.AbstractStore-method-sync" rel="Ext.data.AbstractStore-method-sync" class="docClass">sync</a> instead.</p> <p>Sets the Store's Proxy by string, config object or Proxy instance</p> <p>Sorts the data in the Store by one or more of its properties. Example usage:</p> <pre><code>//sort by a single field myStore.sort('myField', 'DESC'); //sorting by multiple fields myStore.sort([ { property : 'age', direction: 'ASC' }, { property : 'name', direction: 'DESC' } ]); </code></pre> <p>Internally, Store converts the passed arguments into an array of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Ext.util.Sorter</a> instances, and delegates the actual sorting to its internal <a href="#!/api/Ext.util.MixedCollection" rel="Ext.util.MixedCollection" class="docClass">Ext.util.MixedCollection</a>.</p> <p>When passing a single string argument to sort, Store maintains a ASC/DESC toggler per field, so this code:</p> <pre><code>store.sort('myField'); store.sort('myField'); </code></pre> <p>Is equivalent to this code, because Store handles the toggling automatically:</p> <pre><code>store.sort('myField', 'ASC'); store.sort('myField', 'DESC'); </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Sums the value of <tt>property</tt> for each <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">record</a> between <tt>start</tt> and <tt>end</tt> and returns the result.</p> <p>Suspends automatically syncing the Store with its Proxy. Only applicable if <a href="#!/api/Ext.data.AbstractStore-cfg-autoSync" rel="Ext.data.AbstractStore-cfg-autoSync" class="docClass">autoSync</a> is <code>true</code></p> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Synchronizes the store with its <a href="#!/api/Ext.data.AbstractStore-cfg-proxy" rel="Ext.data.AbstractStore-cfg-proxy" class="docClass">proxy</a>. This asks the proxy to batch together any new, updated and deleted records in the store, updating the store's internal representation of the records as each operation completes.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Creates new MixedCollection.</p> <p>Specify <tt>true</tt> if the <a href="#!/api/Ext.util.MixedCollection-method-addAll" rel="Ext.util.MixedCollection-method-addAll" class="docClass">addAll</a> function should add function references to the collection. Defaults to <tt>false</tt>.</p> <p>A function that can accept an item of the type(s) stored in this MixedCollection and return the key value for that item. This is used when available to look up the key on items that were passed without an explicit key parameter to a MixedCollection method. Passing this parameter is equivalent to providing an implementation for the <a href="#!/api/Ext.util.MixedCollection-method-getKey" rel="Ext.util.MixedCollection-method-getKey" class="docClass">getKey</a> method.</p> <p>The default sort direction to use if one is not specified.</p> <p>Flag denoting that this object is sortable. Always true.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>The property in each item that contains the data to sort.</p> <p>The collection of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Sorters</a> currently applied to this Store</p> <p>Adds an item to the collection. Fires the <a href="#!/api/Ext.util.AbstractMixedCollection-event-add" rel="Ext.util.AbstractMixedCollection-event-add" class="docClass">add</a> event when complete.</p> <p>Adds all elements of an Array or an Object to the collection.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all items from the collection. Fires the <a href="#!/api/Ext.util.AbstractMixedCollection-event-clear" rel="Ext.util.AbstractMixedCollection-event-clear" class="docClass">clear</a> event when complete.</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Creates a shallow copy of this collection</p> <p>Collects unique values of a particular property in this MixedCollection</p> <p>Returns true if the collection contains the passed Object as an item.</p> <p>Returns true if the collection contains the passed Object as a key.</p> <p>Executes the specified function once for every item in the collection, passing the following arguments:</p> <div class="mdetail-params"><ul> <li><b>item</b> : Mixed<p class="sub-desc">The collection item</p></li> <li><b>index</b> : Number<p class="sub-desc">The item's index</p></li> <li><b>length</b> : Number<p class="sub-desc">The total number of items in the collection</p></li> </ul></div> <p>The function should return a boolean value. Returning false from the function will stop the iteration.</p> <p>Executes the specified function once for every key in the collection, passing each key, and its associated item as the first two parameters.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Filters the objects in this collection by a set of <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Filter</a>s, or by a single property/value pair with optional parameters for substring matching and case sensitivity. See <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Filter</a> for an example of using Filter objects (preferred). Alternatively, MixedCollection can be easily filtered by property like this:</p> <pre><code>//create a simple store with a few people defined var people = new <a href="#!/api/Ext.util.MixedCollection" rel="Ext.util.MixedCollection" class="docClass">Ext.util.MixedCollection</a>(); people.addAll([ {id: 1, age: 25, name: 'Ed'}, {id: 2, age: 24, name: 'Tommy'}, {id: 3, age: 24, name: 'Arne'}, {id: 4, age: 26, name: 'Aaron'} ]); //a new MixedCollection containing only the items where age == 24 var middleAged = people.filter('age', 24); </code></pre> <p>Filter by a function. Returns a <i>new</i> collection that has been filtered. The passed function will be called with each object in the collection. If the function returns true, the value is included otherwise it is filtered.</p> <p>Returns the first item in the collection which elicits a true return value from the passed selection function.</p> <p>Finds the index of the first matching object in this collection by a specific property/value.</p> <p>Find the index of the first matching object in this collection by a function. If the function returns <i>true</i> it is considered a match.</p> <p>Calculates the insertion index of the new item based upon the comparison function passed, or the current sort order.</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Returns the first item in the collection.</p> <p>Returns a comparator function which compares two items and returns -1, 0, or 1 depending on the currently defined set of <a href="#!/api/Ext.util.Sortable-property-sorters" rel="Ext.util.Sortable-property-sorters" class="docClass">sorters</a>.</p> <p>If there are no <a href="#!/api/Ext.util.Sortable-property-sorters" rel="Ext.util.Sortable-property-sorters" class="docClass">sorters</a> defined, it returns a function which returns <code>0</code> meaning that no sorting will occur.</p> <p>Returns the item associated with the passed key OR index. Key has priority over index. This is the equivalent of calling <a href="#!/api/Ext.util.AbstractMixedCollection-method-getByKey" rel="Ext.util.AbstractMixedCollection-method-getByKey" class="docClass">getByKey</a> first, then if nothing matched calling <a href="#!/api/Ext.util.AbstractMixedCollection-method-getAt" rel="Ext.util.AbstractMixedCollection-method-getAt" class="docClass">getAt</a>.</p> <p>Returns the item at the specified index.</p> <p>Returns all of the errors for the given field</p> <p>Returns the item associated with the passed key.</p> <p>Returns the number of items in the collection.</p> <p>MixedCollection has a generic way to fetch keys if you implement getKey. The default implementation simply returns <b><code>item.id</code></b> but you can provide your own implementation to return a different value as in the following examples:</p> <pre><code>// normal way var mc = new <a href="#!/api/Ext.util.MixedCollection" rel="Ext.util.MixedCollection" class="docClass">Ext.util.MixedCollection</a>(); mc.add(someEl.dom.id, someEl); mc.add(otherEl.dom.id, otherEl); //and so on // using getKey var mc = new <a href="#!/api/Ext.util.MixedCollection" rel="Ext.util.MixedCollection" class="docClass">Ext.util.MixedCollection</a>(); mc.getKey = function(el){ return el.dom.id; }; mc.add(someEl); mc.add(otherEl); // or via the constructor var mc = new <a href="#!/api/Ext.util.MixedCollection" rel="Ext.util.MixedCollection" class="docClass">Ext.util.MixedCollection</a>(false, function(el){ return el.dom.id; }); mc.add(someEl); mc.add(otherEl); </code></pre> <p>Returns a range of items in this collection</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Returns index within the collection of the passed Object.</p> <p>Returns index within the collection of the passed key.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Performs initialization of this mixin. Component classes using this mixin should call this method during their own initialization.</p> <p>Inserts an item at the specified index in the collection. Fires the <a href="#!/api/Ext.util.AbstractMixedCollection-event-add" rel="Ext.util.AbstractMixedCollection-event-add" class="docClass">add</a> event when complete.</p> <p>Returns true if there are no errors in the collection</p> <p>Returns the last item in the collection.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Remove an item from the collection.</p> <p>Remove all items in the passed array from the collection.</p> <p>Remove an item from a specified index in the collection. Fires the <a href="#!/api/Ext.util.AbstractMixedCollection-event-remove" rel="Ext.util.AbstractMixedCollection-event-remove" class="docClass">remove</a> event when complete.</p> <p>Removed an item associated with the passed key fom the collection.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Reorders each of the items based on a mapping from old index to new index. Internally this just translates into a sort. The 'sort' event is fired whenever reordering has occured.</p> <p>Replaces an item in the collection. Fires the <a href="#!/api/Ext.util.AbstractMixedCollection-event-replace" rel="Ext.util.AbstractMixedCollection-event-replace" class="docClass">replace</a> event when complete.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Sorts the data in the Store by one or more of its properties. Example usage:</p> <pre><code>//sort by a single field myStore.sort('myField', 'DESC'); //sorting by multiple fields myStore.sort([ { property : 'age', direction: 'ASC' }, { property : 'name', direction: 'DESC' } ]); </code></pre> <p>Internally, Store converts the passed arguments into an array of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Ext.util.Sorter</a> instances, and delegates the actual sorting to its internal <a href="#!/api/Ext.util.MixedCollection" rel="Ext.util.MixedCollection" class="docClass">Ext.util.MixedCollection</a>.</p> <p>When passing a single string argument to sort, Store maintains a ASC/DESC toggler per field, so this code:</p> <pre><code>store.sort('myField'); store.sort('myField'); </code></pre> <p>Is equivalent to this code, because Store handles the toggling automatically:</p> <pre><code>store.sort('myField', 'ASC'); store.sort('myField', 'DESC'); </code></pre> <p>Sorts the collection by a single sorter function</p> <p>Sorts this collection by <b>key</b>s.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Collects all of the values of the given property and returns their sum</p> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Initializes a new instance.</p> <p>Configuration object to be applied to the new instance.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Generates and returns the next id. This method must be implemented by the derived class.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Specifies the GET parameter that will be sent to the server containing the function name to be executed when the request completes. Defaults to <tt>callback</tt>. Thus, a common request will be in the form of url?callback=Ext.data.JsonP.callback1</p> <p>True to add a unique cache-buster param to requests. Defaults to <tt>true</tt>.</p> <p>Change the parameter which is sent went disabling caching through a cache buster. Defaults to <tt>'_dc'</tt>.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>A default timeout for any JsonP requests. If the request has not completed in this time the failure callback will be fired. The timeout is in ms. Defaults to <tt>30000</tt>.</p> <p>Abort a request. If the request parameter is not specified all open requests will be aborted.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Makes a JSONP request.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Creates the store.</p> <p>Config object</p> <p>Sets the updating behavior based on batch synchronization. 'operation' (the default) will update the Store's internal representation of the data after each operation of the batch has completed, 'complete' will wait until the entire batch has been completed before updating the Store's data. 'complete' is a good choice for local storage proxies, 'operation' is better for remote proxies, where there is a comparatively high latency.</p> <p>The page that the Store has most recently loaded (see <a href="#!/api/Ext.data.Store-method-loadPage" rel="Ext.data.Store-method-loadPage" class="docClass">loadPage</a>)</p> <p>The MixedCollection that holds this store's local cache of records</p> <p>The string type of the Proxy to create if none is specified. This defaults to creating a <a href="#!/api/Ext.data.proxy.Memory" rel="Ext.data.proxy.Memory" class="docClass">memory proxy</a>.</p> <p>The default sort direction to use if one is not specified.</p> <p>If true, any filters attached to this Store will be run after loading data, before the datachanged event is fired. Defaults to true, ignored if <a href="#!/api/Ext.data.Store-cfg-remoteFilter" rel="Ext.data.Store-cfg-remoteFilter" class="docClass">remoteFilter</a> is true</p> <p>The collection of <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Filters</a> currently applied to this Store</p> <p>The collection of <a href="#!/api/Ext.util.Grouper" rel="Ext.util.Grouper" class="docClass">Groupers</a> currently applied to this Store</p> <p>True if the Store has already been destroyed. If this is true, the reference to Store should be deleted as it will not function correctly any more.</p> <p>Flag denoting that this object is sortable. Always true.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>A pristine (unfiltered) collection of the records in this store. This is used to reinstate records when a filter is removed or changed</p> <p>If true, any sorters attached to this Store will be run after loading data, before the datachanged event is fired. Defaults to true, igored if <a href="#!/api/Ext.data.Store-cfg-remoteSort" rel="Ext.data.Store-cfg-remoteSort" class="docClass">remoteSort</a> is true</p> <p>The property in each item that contains the data to sort.</p> <p>The collection of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Sorters</a> currently applied to this Store</p> <p>Adds Model instance to the Store. This method accepts either:</p> <ul> <li>An array of Model instances or Model configuration objects.</li> <li>Any number of Model instance or Model configuration object arguments.</li> </ul> <p>The new Model instances will be added at the end of the existing collection.</p> <p>Sample usage:</p> <pre><code>myStore.add({some: 'data'}, {some: 'other data'}); </code></pre> <p>Note that if this Store is sorted, the new Model instances will be inserted at the correct point in the Store to maintain the sort order.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>(Local sort only) Inserts the passed Record into the Store at the index where it should go based on the current sort information.</p> <p>Runs the aggregate function for all the records in the store.</p> <p>Gets the average value in the store.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Revert to a view of the Record cache with no filtering applied.</p> <p>Clear any groupers in the store</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Collects unique values for a particular dataIndex from this store.</p> <p>Commit all Records with <a href="#!/api/Ext.data.Store-method-getModifiedRecords" rel="Ext.data.Store-method-getModifiedRecords" class="docClass">outstanding changes</a>. To handle updates for changes, subscribe to the Store's <a href="#!/api/Ext.data.Store-event-update" rel="Ext.data.Store-event-update" class="docClass">update event</a>, and perform updating when the third parameter is Ext.data.Record.COMMIT.</p> <p>Gets the count of items in the store.</p> <p>Calls the specified function for each of the <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Records</a> in the cache.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Filters the loaded set of records by a given set of filters.</p> <p>Filtering by single field:</p> <pre><code>store.filter("email", /\.com$/); </code></pre> <p>Using multiple filters:</p> <pre><code>store.filter([ {property: "email", value: /\.com$/}, {filterFn: function(item) { return item.get("age") &gt; 10; }} ]); </code></pre> <p>Using <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a> instances instead of config objects (note that we need to specify the <a href="#!/api/Ext.util.Filter-cfg-root" rel="Ext.util.Filter-cfg-root" class="docClass">root</a> config option in this case):</p> <pre><code>store.filter([ <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a>', {property: "email", value: /\.com$/, root: 'data'}), <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a>', {filterFn: function(item) { return item.get("age") &gt; 10; }, root: 'data'}) ]); </code></pre> <p>Filter by a function. The specified function will be called for each Record in this Store. If the function returns <tt>true</tt> the Record is included, otherwise it is filtered out.</p> <p>Finds the index of the first matching Record in this store by a specific field value.</p> <p>Find the index of the first matching Record in this Store by a function. If the function returns <tt>true</tt> it is considered a match.</p> <p>Finds the index of the first matching Record in this store by a specific field value.</p> <p>Finds the first matching Record in this store by a specific field value.</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Convenience function for getting the first model instance in the store</p> <p>Returns a comparator function which compares two items and returns -1, 0, or 1 depending on the currently defined set of <a href="#!/api/Ext.util.Sortable-property-sorters" rel="Ext.util.Sortable-property-sorters" class="docClass">sorters</a>.</p> <p>If there are no <a href="#!/api/Ext.util.Sortable-property-sorters" rel="Ext.util.Sortable-property-sorters" class="docClass">sorters</a> defined, it returns a function which returns <code>0</code> meaning that no sorting will occur.</p> <p>Get the Record at the specified index.</p> <p>Get the Record with the specified id.</p> <p>Gets the number of cached records.</p> <p>If using paging, this may not be the total size of the dataset. If the data object used by the Reader contains the dataset size, then the <a href="#!/api/Ext.data.Store-method-getTotalCount" rel="Ext.data.Store-method-getTotalCount" class="docClass">getTotalCount</a> function returns the dataset size. <b>Note</b>: see the Important note in <a href="#!/api/Ext.data.Store-method-load" rel="Ext.data.Store-method-load" class="docClass">load</a>.</p> <p>Returns the string to group on for a given model instance. The default implementation of this method returns the model's <a href="#!/api/Ext.data.Store-cfg-groupField" rel="Ext.data.Store-cfg-groupField" class="docClass">groupField</a>, but this can be overridden to group by an arbitrary string. For example, to group by the first letter of a model's 'name' field, use the following code:</p> <pre><code> <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>', { groupDir: 'ASC', getGroupString: function(instance) { return instance.get('name')[0]; } }); </code></pre> <p>Returns an array containing the result of applying grouping to the records in this store. See <a href="#!/api/Ext.data.Store-cfg-groupField" rel="Ext.data.Store-cfg-groupField" class="docClass">groupField</a>, <a href="#!/api/Ext.data.Store-cfg-groupDir" rel="Ext.data.Store-cfg-groupDir" class="docClass">groupDir</a> and <a href="#!/api/Ext.data.Store-method-getGroupString" rel="Ext.data.Store-method-getGroupString" class="docClass">getGroupString</a>. Example for a store containing records with a color field:</p> <pre><code> var myStore = <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>', { groupField: 'color', groupDir : 'DESC' }); myStore.getGroups(); //returns: [ { name: 'yellow', children: [ //all records where the color field is 'yellow' ] }, { name: 'red', children: [ //all records where the color field is 'red' ] } ] </code></pre> <p>Gets all <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">records</a> added or updated since the last commit. Note that the order of records returned is not deterministic and does not indicate the order in which records were modified. Note also that removed records are not included (use <a href="#!/api/Ext.data.AbstractStore-method-getRemovedRecords" rel="Ext.data.AbstractStore-method-getRemovedRecords" class="docClass">getRemovedRecords</a> for that).</p> <p>Returns all Model instances that are either currently a phantom (e.g. have no id), or have an ID but have not yet been saved on this Store (this happens when adding a non-phantom record from another Store into this one)</p> <p>Determines the page from a record index</p> <p>Returns the proxy currently attached to this proxy instance</p> <p>Returns a range of Records between specified indices.</p> <p>Returns any records that have been removed from the store but not yet destroyed on the proxy.</p> <p>Returns the total number of <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Model</a> instances that the <a href="#!/api/Ext.data.proxy.Proxy" rel="Ext.data.proxy.Proxy" class="docClass">Proxy</a> indicates exist. This will usually differ from <a href="#!/api/Ext.data.Store-method-getCount" rel="Ext.data.Store-method-getCount" class="docClass">getCount</a> when using paging - getCount returns the number of records loaded into the Store at the moment, getTotalCount returns the number of records that could be loaded into the Store if the Store contained all data</p> <p>Returns all Model instances that have been updated in the Store but not yet synchronized with the Proxy</p> <p>Group data in the store</p> <p>Guarantee a specific range, this will load the store with a range (that must be the pageSize or smaller) and take care of any loading that may be necessary.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Returns the number of pending requests out.</p> <p>Get the index within the cache of the passed Record.</p> <p>Get the index within the cache of the Record with the passed id.</p> <p>Get the index within the entire dataset. From 0 to the totalCount.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Performs initialization of this mixin. Component classes using this mixin should call this method during their own initialization.</p> <p>Inserts Model instances into the Store at the given index and fires the <a href="#!/api/Ext.data.Store-event-add" rel="Ext.data.Store-event-add" class="docClass">add</a> event. See also <code><a href="#!/api/Ext.data.Store-method-add" rel="Ext.data.Store-method-add" class="docClass">add</a></code>.</p> <p>Returns true if this store is currently filtered</p> <p>Checks if the store is currently grouped</p> <p>Returns true if the Store is currently performing a load operation</p> <p>Convenience function for getting the last model instance in the store</p> <p>Loads data into the Store via the configured <a href="#!/api/Ext.data.Store-cfg-proxy" rel="Ext.data.Store-cfg-proxy" class="docClass">proxy</a>. This uses the Proxy to make an asynchronous call to whatever storage backend the Proxy uses, automatically adding the retrieved instances into the Store and calling an optional callback if required. Example usage:</p> <pre><code>store.load({ scope: this, callback: function(records, operation, success) { // the <a href="#!/api/Ext.data.Operation" rel="Ext.data.Operation" class="docClass">operation</a> object // contains all of the details of the load operation console.log(records); } }); </code></pre> <p>If the callback scope does not need to be set, a function can simply be passed:</p> <pre><code>store.load(function(records, operation, success) { console.log('loaded records'); }); </code></pre> <p>Loads an array of data straight into the Store.</p> <p>Using this method is great if the data is in the correct format already (e.g. it doesn't need to be processed by a reader). If your data requires processing to decode the data structure, use a <a href="#!/api/Ext.data.proxy.Memory" rel="Ext.data.proxy.Memory" class="docClass">MemoryProxy</a> instead.</p> <p>Loads a given 'page' of data by setting the start and limit values appropriately. Internally this just causes a normal load operation, passing in calculated 'start' and 'limit' params</p> <p>Loads data via the bound Proxy's reader</p> <p>Use this method if you are attempting to load data and want to utilize the configured data reader.</p> <p>Loads an array of <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">model</a> instances into the store, fires the datachanged event. This should only usually be called internally when loading from the <a href="#!/api/Ext.data.proxy.Proxy" rel="Ext.data.proxy.Proxy" class="docClass">Proxy</a>, when adding records manually use <a href="#!/api/Ext.data.Store-method-add" rel="Ext.data.Store-method-add" class="docClass">add</a> instead</p> <p>Gets the maximum value in the store.</p> <p>Gets the minimum value in the store.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Loads the next 'page' in the current data set</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Prefetches data into the store using its configured <a href="#!/api/Ext.data.Store-cfg-proxy" rel="Ext.data.Store-cfg-proxy" class="docClass">proxy</a>.</p> <p>Prefetches a page of data.</p> <p>Loads the previous 'page' in the current data set</p> <p>Purge the least recently used records in the prefetch if the purgeCount has been exceeded.</p> <p>Query the cached records in this Store using a filtering function. The specified function will be called with each record in this Store. If the function returns <tt>true</tt> the record is included in the results.</p> <p><a href="#!/api/Ext.data.Model-method-reject" rel="Ext.data.Model-method-reject" class="docClass">Reject</a> outstanding changes on all <a href="#!/api/Ext.data.Store-method-getModifiedRecords" rel="Ext.data.Store-method-getModifiedRecords" class="docClass">modified records</a> and re-insert any records that were removed locally. Any phantom records will be removed.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes the given record from the Store, firing the 'remove' event for each instance that is removed, plus a single 'datachanged' event after removal.</p> <p>Remove all items from the store.</p> <p>Removes the model instance at the given index</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes automatically syncing the Store with its Proxy. Only applicable if <a href="#!/api/Ext.data.AbstractStore-cfg-autoSync" rel="Ext.data.AbstractStore-cfg-autoSync" class="docClass">autoSync</a> is <code>true</code></p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Saves all pending changes via the configured <a href="#!/api/Ext.data.AbstractStore-cfg-proxy" rel="Ext.data.AbstractStore-cfg-proxy" class="docClass">proxy</a>. Use <a href="#!/api/Ext.data.AbstractStore-method-sync" rel="Ext.data.AbstractStore-method-sync" class="docClass">sync</a> instead.</p> <p>Sets the Store's Proxy by string, config object or Proxy instance</p> <p>Sorts the data in the Store by one or more of its properties. Example usage:</p> <pre><code>//sort by a single field myStore.sort('myField', 'DESC'); //sorting by multiple fields myStore.sort([ { property : 'age', direction: 'ASC' }, { property : 'name', direction: 'DESC' } ]); </code></pre> <p>Internally, Store converts the passed arguments into an array of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Ext.util.Sorter</a> instances, and delegates the actual sorting to its internal <a href="#!/api/Ext.util.MixedCollection" rel="Ext.util.MixedCollection" class="docClass">Ext.util.MixedCollection</a>.</p> <p>When passing a single string argument to sort, Store maintains a ASC/DESC toggler per field, so this code:</p> <pre><code>store.sort('myField'); store.sort('myField'); </code></pre> <p>Is equivalent to this code, because Store handles the toggling automatically:</p> <pre><code>store.sort('myField', 'ASC'); store.sort('myField', 'DESC'); </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Sums the value of <tt>property</tt> for each <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">record</a> between <tt>start</tt> and <tt>end</tt> and returns the result.</p> <p>Suspends automatically syncing the Store with its Proxy. Only applicable if <a href="#!/api/Ext.data.AbstractStore-cfg-autoSync" rel="Ext.data.AbstractStore-cfg-autoSync" class="docClass">autoSync</a> is <code>true</code></p> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Synchronizes the store with its <a href="#!/api/Ext.data.AbstractStore-cfg-proxy" rel="Ext.data.AbstractStore-cfg-proxy" class="docClass">proxy</a>. This asks the proxy to batch together any new, updated and deleted records in the store, updating the store's internal representation of the records as each operation completes.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Creates the store.</p> <p>Config object</p> <p>Sets the updating behavior based on batch synchronization. 'operation' (the default) will update the Store's internal representation of the data after each operation of the batch has completed, 'complete' will wait until the entire batch has been completed before updating the Store's data. 'complete' is a good choice for local storage proxies, 'operation' is better for remote proxies, where there is a comparatively high latency.</p> <p>The page that the Store has most recently loaded (see <a href="#!/api/Ext.data.Store-method-loadPage" rel="Ext.data.Store-method-loadPage" class="docClass">loadPage</a>)</p> <p>The MixedCollection that holds this store's local cache of records</p> <p>The string type of the Proxy to create if none is specified. This defaults to creating a <a href="#!/api/Ext.data.proxy.Memory" rel="Ext.data.proxy.Memory" class="docClass">memory proxy</a>.</p> <p>The default sort direction to use if one is not specified.</p> <p>If true, any filters attached to this Store will be run after loading data, before the datachanged event is fired. Defaults to true, ignored if <a href="#!/api/Ext.data.Store-cfg-remoteFilter" rel="Ext.data.Store-cfg-remoteFilter" class="docClass">remoteFilter</a> is true</p> <p>The collection of <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Filters</a> currently applied to this Store</p> <p>The collection of <a href="#!/api/Ext.util.Grouper" rel="Ext.util.Grouper" class="docClass">Groupers</a> currently applied to this Store</p> <p>True if the Store has already been destroyed. If this is true, the reference to Store should be deleted as it will not function correctly any more.</p> <p>Flag denoting that this object is sortable. Always true.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>A pristine (unfiltered) collection of the records in this store. This is used to reinstate records when a filter is removed or changed</p> <p>If true, any sorters attached to this Store will be run after loading data, before the datachanged event is fired. Defaults to true, igored if <a href="#!/api/Ext.data.Store-cfg-remoteSort" rel="Ext.data.Store-cfg-remoteSort" class="docClass">remoteSort</a> is true</p> <p>The property in each item that contains the data to sort.</p> <p>The collection of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Sorters</a> currently applied to this Store</p> <p>Adds Model instance to the Store. This method accepts either:</p> <ul> <li>An array of Model instances or Model configuration objects.</li> <li>Any number of Model instance or Model configuration object arguments.</li> </ul> <p>The new Model instances will be added at the end of the existing collection.</p> <p>Sample usage:</p> <pre><code>myStore.add({some: 'data'}, {some: 'other data'}); </code></pre> <p>Note that if this Store is sorted, the new Model instances will be inserted at the correct point in the Store to maintain the sort order.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>(Local sort only) Inserts the passed Record into the Store at the index where it should go based on the current sort information.</p> <p>Runs the aggregate function for all the records in the store.</p> <p>Gets the average value in the store.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Revert to a view of the Record cache with no filtering applied.</p> <p>Clear any groupers in the store</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Collects unique values for a particular dataIndex from this store.</p> <p>Commit all Records with <a href="#!/api/Ext.data.Store-method-getModifiedRecords" rel="Ext.data.Store-method-getModifiedRecords" class="docClass">outstanding changes</a>. To handle updates for changes, subscribe to the Store's <a href="#!/api/Ext.data.Store-event-update" rel="Ext.data.Store-event-update" class="docClass">update event</a>, and perform updating when the third parameter is Ext.data.Record.COMMIT.</p> <p>Gets the count of items in the store.</p> <p>Calls the specified function for each of the <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Records</a> in the cache.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Filters the loaded set of records by a given set of filters.</p> <p>Filtering by single field:</p> <pre><code>store.filter("email", /\.com$/); </code></pre> <p>Using multiple filters:</p> <pre><code>store.filter([ {property: "email", value: /\.com$/}, {filterFn: function(item) { return item.get("age") &gt; 10; }} ]); </code></pre> <p>Using <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a> instances instead of config objects (note that we need to specify the <a href="#!/api/Ext.util.Filter-cfg-root" rel="Ext.util.Filter-cfg-root" class="docClass">root</a> config option in this case):</p> <pre><code>store.filter([ <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a>', {property: "email", value: /\.com$/, root: 'data'}), <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a>', {filterFn: function(item) { return item.get("age") &gt; 10; }, root: 'data'}) ]); </code></pre> <p>Filter by a function. The specified function will be called for each Record in this Store. If the function returns <tt>true</tt> the Record is included, otherwise it is filtered out.</p> <p>Finds the index of the first matching Record in this store by a specific field value.</p> <p>Find the index of the first matching Record in this Store by a function. If the function returns <tt>true</tt> it is considered a match.</p> <p>Finds the index of the first matching Record in this store by a specific field value.</p> <p>Finds the first matching Record in this store by a specific field value.</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Convenience function for getting the first model instance in the store</p> <p>Returns a comparator function which compares two items and returns -1, 0, or 1 depending on the currently defined set of <a href="#!/api/Ext.util.Sortable-property-sorters" rel="Ext.util.Sortable-property-sorters" class="docClass">sorters</a>.</p> <p>If there are no <a href="#!/api/Ext.util.Sortable-property-sorters" rel="Ext.util.Sortable-property-sorters" class="docClass">sorters</a> defined, it returns a function which returns <code>0</code> meaning that no sorting will occur.</p> <p>Get the Record at the specified index.</p> <p>Get the Record with the specified id.</p> <p>Gets the number of cached records.</p> <p>If using paging, this may not be the total size of the dataset. If the data object used by the Reader contains the dataset size, then the <a href="#!/api/Ext.data.Store-method-getTotalCount" rel="Ext.data.Store-method-getTotalCount" class="docClass">getTotalCount</a> function returns the dataset size. <b>Note</b>: see the Important note in <a href="#!/api/Ext.data.Store-method-load" rel="Ext.data.Store-method-load" class="docClass">load</a>.</p> <p>Returns the string to group on for a given model instance. The default implementation of this method returns the model's <a href="#!/api/Ext.data.Store-cfg-groupField" rel="Ext.data.Store-cfg-groupField" class="docClass">groupField</a>, but this can be overridden to group by an arbitrary string. For example, to group by the first letter of a model's 'name' field, use the following code:</p> <pre><code> <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>', { groupDir: 'ASC', getGroupString: function(instance) { return instance.get('name')[0]; } }); </code></pre> <p>Returns an array containing the result of applying grouping to the records in this store. See <a href="#!/api/Ext.data.Store-cfg-groupField" rel="Ext.data.Store-cfg-groupField" class="docClass">groupField</a>, <a href="#!/api/Ext.data.Store-cfg-groupDir" rel="Ext.data.Store-cfg-groupDir" class="docClass">groupDir</a> and <a href="#!/api/Ext.data.Store-method-getGroupString" rel="Ext.data.Store-method-getGroupString" class="docClass">getGroupString</a>. Example for a store containing records with a color field:</p> <pre><code> var myStore = <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>', { groupField: 'color', groupDir : 'DESC' }); myStore.getGroups(); //returns: [ { name: 'yellow', children: [ //all records where the color field is 'yellow' ] }, { name: 'red', children: [ //all records where the color field is 'red' ] } ] </code></pre> <p>Gets all <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">records</a> added or updated since the last commit. Note that the order of records returned is not deterministic and does not indicate the order in which records were modified. Note also that removed records are not included (use <a href="#!/api/Ext.data.AbstractStore-method-getRemovedRecords" rel="Ext.data.AbstractStore-method-getRemovedRecords" class="docClass">getRemovedRecords</a> for that).</p> <p>Returns all Model instances that are either currently a phantom (e.g. have no id), or have an ID but have not yet been saved on this Store (this happens when adding a non-phantom record from another Store into this one)</p> <p>Determines the page from a record index</p> <p>Returns the proxy currently attached to this proxy instance</p> <p>Returns a range of Records between specified indices.</p> <p>Returns any records that have been removed from the store but not yet destroyed on the proxy.</p> <p>Returns the total number of <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Model</a> instances that the <a href="#!/api/Ext.data.proxy.Proxy" rel="Ext.data.proxy.Proxy" class="docClass">Proxy</a> indicates exist. This will usually differ from <a href="#!/api/Ext.data.Store-method-getCount" rel="Ext.data.Store-method-getCount" class="docClass">getCount</a> when using paging - getCount returns the number of records loaded into the Store at the moment, getTotalCount returns the number of records that could be loaded into the Store if the Store contained all data</p> <p>Returns all Model instances that have been updated in the Store but not yet synchronized with the Proxy</p> <p>Group data in the store</p> <p>Guarantee a specific range, this will load the store with a range (that must be the pageSize or smaller) and take care of any loading that may be necessary.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Returns the number of pending requests out.</p> <p>Get the index within the cache of the passed Record.</p> <p>Get the index within the cache of the Record with the passed id.</p> <p>Get the index within the entire dataset. From 0 to the totalCount.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Performs initialization of this mixin. Component classes using this mixin should call this method during their own initialization.</p> <p>Inserts Model instances into the Store at the given index and fires the <a href="#!/api/Ext.data.Store-event-add" rel="Ext.data.Store-event-add" class="docClass">add</a> event. See also <code><a href="#!/api/Ext.data.Store-method-add" rel="Ext.data.Store-method-add" class="docClass">add</a></code>.</p> <p>Returns true if this store is currently filtered</p> <p>Checks if the store is currently grouped</p> <p>Returns true if the Store is currently performing a load operation</p> <p>Convenience function for getting the last model instance in the store</p> <p>Loads data into the Store via the configured <a href="#!/api/Ext.data.Store-cfg-proxy" rel="Ext.data.Store-cfg-proxy" class="docClass">proxy</a>. This uses the Proxy to make an asynchronous call to whatever storage backend the Proxy uses, automatically adding the retrieved instances into the Store and calling an optional callback if required. Example usage:</p> <pre><code>store.load({ scope: this, callback: function(records, operation, success) { // the <a href="#!/api/Ext.data.Operation" rel="Ext.data.Operation" class="docClass">operation</a> object // contains all of the details of the load operation console.log(records); } }); </code></pre> <p>If the callback scope does not need to be set, a function can simply be passed:</p> <pre><code>store.load(function(records, operation, success) { console.log('loaded records'); }); </code></pre> <p>Loads an array of data straight into the Store.</p> <p>Using this method is great if the data is in the correct format already (e.g. it doesn't need to be processed by a reader). If your data requires processing to decode the data structure, use a <a href="#!/api/Ext.data.proxy.Memory" rel="Ext.data.proxy.Memory" class="docClass">MemoryProxy</a> instead.</p> <p>Loads a given 'page' of data by setting the start and limit values appropriately. Internally this just causes a normal load operation, passing in calculated 'start' and 'limit' params</p> <p>Loads data via the bound Proxy's reader</p> <p>Use this method if you are attempting to load data and want to utilize the configured data reader.</p> <p>Loads an array of <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">model</a> instances into the store, fires the datachanged event. This should only usually be called internally when loading from the <a href="#!/api/Ext.data.proxy.Proxy" rel="Ext.data.proxy.Proxy" class="docClass">Proxy</a>, when adding records manually use <a href="#!/api/Ext.data.Store-method-add" rel="Ext.data.Store-method-add" class="docClass">add</a> instead</p> <p>Gets the maximum value in the store.</p> <p>Gets the minimum value in the store.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Loads the next 'page' in the current data set</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Prefetches data into the store using its configured <a href="#!/api/Ext.data.Store-cfg-proxy" rel="Ext.data.Store-cfg-proxy" class="docClass">proxy</a>.</p> <p>Prefetches a page of data.</p> <p>Loads the previous 'page' in the current data set</p> <p>Purge the least recently used records in the prefetch if the purgeCount has been exceeded.</p> <p>Query the cached records in this Store using a filtering function. The specified function will be called with each record in this Store. If the function returns <tt>true</tt> the record is included in the results.</p> <p><a href="#!/api/Ext.data.Model-method-reject" rel="Ext.data.Model-method-reject" class="docClass">Reject</a> outstanding changes on all <a href="#!/api/Ext.data.Store-method-getModifiedRecords" rel="Ext.data.Store-method-getModifiedRecords" class="docClass">modified records</a> and re-insert any records that were removed locally. Any phantom records will be removed.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes the given record from the Store, firing the 'remove' event for each instance that is removed, plus a single 'datachanged' event after removal.</p> <p>Remove all items from the store.</p> <p>Removes the model instance at the given index</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes automatically syncing the Store with its Proxy. Only applicable if <a href="#!/api/Ext.data.AbstractStore-cfg-autoSync" rel="Ext.data.AbstractStore-cfg-autoSync" class="docClass">autoSync</a> is <code>true</code></p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Saves all pending changes via the configured <a href="#!/api/Ext.data.AbstractStore-cfg-proxy" rel="Ext.data.AbstractStore-cfg-proxy" class="docClass">proxy</a>. Use <a href="#!/api/Ext.data.AbstractStore-method-sync" rel="Ext.data.AbstractStore-method-sync" class="docClass">sync</a> instead.</p> <p>Sets the Store's Proxy by string, config object or Proxy instance</p> <p>Sorts the data in the Store by one or more of its properties. Example usage:</p> <pre><code>//sort by a single field myStore.sort('myField', 'DESC'); //sorting by multiple fields myStore.sort([ { property : 'age', direction: 'ASC' }, { property : 'name', direction: 'DESC' } ]); </code></pre> <p>Internally, Store converts the passed arguments into an array of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Ext.util.Sorter</a> instances, and delegates the actual sorting to its internal <a href="#!/api/Ext.util.MixedCollection" rel="Ext.util.MixedCollection" class="docClass">Ext.util.MixedCollection</a>.</p> <p>When passing a single string argument to sort, Store maintains a ASC/DESC toggler per field, so this code:</p> <pre><code>store.sort('myField'); store.sort('myField'); </code></pre> <p>Is equivalent to this code, because Store handles the toggling automatically:</p> <pre><code>store.sort('myField', 'ASC'); store.sort('myField', 'DESC'); </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Sums the value of <tt>property</tt> for each <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">record</a> between <tt>start</tt> and <tt>end</tt> and returns the result.</p> <p>Suspends automatically syncing the Store with its Proxy. Only applicable if <a href="#!/api/Ext.data.AbstractStore-cfg-autoSync" rel="Ext.data.AbstractStore-cfg-autoSync" class="docClass">autoSync</a> is <code>true</code></p> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Synchronizes the store with its <a href="#!/api/Ext.data.AbstractStore-cfg-proxy" rel="Ext.data.AbstractStore-cfg-proxy" class="docClass">proxy</a>. This asks the proxy to batch together any new, updated and deleted records in the store, updating the store's internal representation of the records as each operation completes.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Creates new Model instance.</p> <p>An object containing keys corresponding to this model's fields, and their associated values</p> <p>True if this Record has been modified.</p> <p>Internal flag used to track whether or not the model instance is currently being edited.</p> <p>The fields defined on this model.</p> <p>Key: value pairs of all fields whose values have changed</p> <p>True when the record does not yet exist in a server-side database (see <a href="#!/api/Ext.data.Model-method-setDirty" rel="Ext.data.Model-method-setDirty" class="docClass">setDirty</a>). Any record which has a real database pk set as its id property is NOT a phantom -- it's real.</p> <p>The raw data used to create this model if created via a reader.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>An array of <a href="#!/api/Ext.data.AbstractStore" rel="Ext.data.AbstractStore" class="docClass">Ext.data.AbstractStore</a> objects that this record is bound to.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Begins an edit. While in edit mode, no events (e.g.. the <code>update</code> event) are relayed to the containing store. When an edit has begun, it must be followed by either <a href="#!/api/Ext.data.Model-method-endEdit" rel="Ext.data.Model-method-endEdit" class="docClass">endEdit</a> or <a href="#!/api/Ext.data.Model-method-cancelEdit" rel="Ext.data.Model-method-cancelEdit" class="docClass">cancelEdit</a>.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Cancels all changes made in the current edit operation.</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Usually called by the <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a> which owns the model instance. Commits all changes made to the instance since either creation or the last commit operation.</p> <p>Developers should subscribe to the <a href="#!/api/Ext.data.Store-event-update" rel="Ext.data.Store-event-update" class="docClass">Ext.data.Store.update</a> event to have their code notified of commit operations.</p> <p>Creates a copy (clone) of this Model instance.</p> <p>Destroys the model using the configured proxy.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Ends an edit. If any data was modified, the containing store is notified (ie, the store's <code>update</code> event will fire).</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Returns the value of the given field</p> <p>Gets all of the data from this Models <em>loaded</em> associations. It does this recursively - for example if we have a User which hasMany Orders, and each Order hasMany OrderItems, it will return an object like this:</p> <pre><code>{ orders: [ { id: 123, status: 'shipped', orderItems: [ ... ] } ] } </code></pre> <p>Gets a hash of only the fields that have been modified since this Model was created or commited.</p> <p>Gets all values for each field in this model and returns an object containing the current data.</p> <p>Returns the unique ID allocated to this model instance as defined by <a href="#!/api/Ext.data.Model-cfg-idProperty" rel="Ext.data.Model-cfg-idProperty" class="docClass">idProperty</a>.</p> <p>Returns the configured Proxy for this Model.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Returns true if the passed field name has been <code><a href="#!/api/Ext.data.Model-property-modified" rel="Ext.data.Model-property-modified" class="docClass">modified</a></code> since the load or last commit.</p> <p>Checks if the model is valid. See <a href="#!/api/Ext.data.Model-method-validate" rel="Ext.data.Model-method-validate" class="docClass">validate</a>.</p> <p>Tells this model instance that it has been added to a store.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Usually called by the <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a> to which this model instance has been <a href="#!/api/Ext.data.Model-method-join" rel="Ext.data.Model-method-join" class="docClass">joined</a>. Rejects all changes made to the model instance since either creation, or the last commit operation. Modified fields are reverted to their original values.</p> <p>Developers should subscribe to the <a href="#!/api/Ext.data.Store-event-update" rel="Ext.data.Store-event-update" class="docClass">Ext.data.Store.update</a> event to have their code notified of reject operations.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Saves the model instance using the configured proxy.</p> <p>Sets the given field to the given value, marks the instance as dirty</p> <p>Marks this <strong>Record</strong> as <code><a href="#!/api/Ext.data.Model-property-dirty" rel="Ext.data.Model-property-dirty" class="docClass">dirty</a></code>. This method is used interally when adding <code><a href="#!/api/Ext.data.Model-property-phantom" rel="Ext.data.Model-property-phantom" class="docClass">phantom</a></code> records to a <a href="#!/api/Ext.data.proxy.Server-cfg-writer" rel="Ext.data.proxy.Server-cfg-writer" class="docClass">writer enabled store</a>.</p> <p>Marking a record <code><a href="#!/api/Ext.data.Model-property-dirty" rel="Ext.data.Model-property-dirty" class="docClass">dirty</a></code> causes the phantom to be returned by <a href="#!/api/Ext.data.Store-method-getUpdatedRecords" rel="Ext.data.Store-method-getUpdatedRecords" class="docClass">Ext.data.Store.getUpdatedRecords</a> where it will have a create action composed for it during <a href="#!/api/Ext.data.Model-method-save" rel="Ext.data.Model-method-save" class="docClass">model save</a> operations.</p> <p>Sets the model instance's id field to the given id.</p> <p>Sets the Proxy to use for this model. Accepts any options that can be accepted by <a href="#!/api/Ext-method-createByAlias" rel="Ext-method-createByAlias" class="docClass">Ext.createByAlias</a>.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Tells this model instance that it has been removed from the store.</p> <p>Validates the current data against all of its configured <a href="#!/api/Ext.data.Model-cfg-validations" rel="Ext.data.Model-cfg-validations" class="docClass">validations</a>.</p> <p>An array of this nodes children. Array will be empty if this node has no chidren.</p> <p>A reference to this node's first child node. <code>null</code> if this node has no children.</p> <p>A reference to this node's last child node. <code>null</code> if this node has no children.</p> <p>A reference to this node's next sibling node. <code>null</code> if this node does not have a next sibling.</p> <p>A reference to this node's parent node. <code>null</code> if this node is the root node.</p> <p>A reference to this node's previous sibling node. <code>null</code> if this node does not have a previous sibling.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Inserts node(s) as the last child node of this node.</p> <p>If the node was previously a child node of another parent node, it will be removed from that node first.</p> <p>Bubbles up the tree from this node, calling the specified function with each node. The arguments to the function will be the args provided or the current node. If the function returns false at any point, the bubble is stopped.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Cascades down the tree from this node, calling the specified function with each node. The arguments to the function will be the args provided or the current node. If the function returns false at any point, the cascade is stopped on that branch.</p> <p>Collapse this node.</p> <p>Collapse all the children of this node.</p> <p>Returns true if this node is an ancestor (at any point) of the passed node.</p> <p>Creates a copy (clone) of this Node.</p> <p>Ensures that the passed object is an instance of a Record with the NodeInterface applied</p> <p>Destroys the node.</p> <p>Interates the child nodes of this node, calling the specified function with each node. The arguments to the function will be the args provided or the current node. If the function returns false at any point, the iteration stops.</p> <p>Expand this node.</p> <p>Expand all the children of this node.</p> <p>Finds the first child that has the attribute with the specified value.</p> <p>Finds the first child by a custom function. The child matches if the function passed returns true.</p> <p>Returns the child node at the specified index.</p> <p>Returns depth of this node (the root node has a depth of 0)</p> <p>Gets the hierarchical path from the root of the current node.</p> <p>Returns true if this node has one or more child nodes, else false.</p> <p>Returns the index of a child node</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Inserts the first node before the second node in this nodes childNodes collection.</p> <p>Insert a node into this node</p> <p>Returns true if the passed node is an ancestor (at any point) of this node.</p> <p>Returns true if this node has one or more child nodes, or if the <tt>expandable</tt> node attribute is explicitly specified as true, otherwise returns false.</p> <p>Returns true if this node is expaned</p> <p>Returns true if this node is the first child of its parent</p> <p>Returns true if this node is the last child of its parent</p> <p>Returns true if this node is a leaf</p> <p>Returns true if this node is loaded</p> <p>Returns true if this node is loading</p> <p>Returns true if this node is the root node</p> <p>Returns true if this node is visible</p> <p>Removes this node from its parent</p> <p>Removes all child nodes from this node.</p> <p>Removes a child node from this node.</p> <p>Replaces one child node in this node with another.</p> <p>Sorts this nodes children using the supplied sort function.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Updates general data of this node like isFirst, isLast, depth. This method is internally called after a node is moved. This shouldn't have to be called by the developer unless they are creating custom Tree plugins.</p> <p>Creates the store.</p> <p>Config object</p> <p>Sets the updating behavior based on batch synchronization. 'operation' (the default) will update the Store's internal representation of the data after each operation of the batch has completed, 'complete' will wait until the entire batch has been completed before updating the Store's data. 'complete' is a good choice for local storage proxies, 'operation' is better for remote proxies, where there is a comparatively high latency.</p> <p>The page that the Store has most recently loaded (see <a href="#!/api/Ext.data.Store-method-loadPage" rel="Ext.data.Store-method-loadPage" class="docClass">loadPage</a>)</p> <p>The MixedCollection that holds this store's local cache of records</p> <p>The string type of the Proxy to create if none is specified. This defaults to creating a <a href="#!/api/Ext.data.proxy.Memory" rel="Ext.data.proxy.Memory" class="docClass">memory proxy</a>.</p> <p>The default sort direction to use if one is not specified.</p> <p>If true, any filters attached to this Store will be run after loading data, before the datachanged event is fired. Defaults to true, ignored if <a href="#!/api/Ext.data.Store-cfg-remoteFilter" rel="Ext.data.Store-cfg-remoteFilter" class="docClass">remoteFilter</a> is true</p> <p>The collection of <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Filters</a> currently applied to this Store</p> <p>The collection of <a href="#!/api/Ext.util.Grouper" rel="Ext.util.Grouper" class="docClass">Groupers</a> currently applied to this Store</p> <p>True if the Store has already been destroyed. If this is true, the reference to Store should be deleted as it will not function correctly any more.</p> <p>Flag denoting that this object is sortable. Always true.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>A pristine (unfiltered) collection of the records in this store. This is used to reinstate records when a filter is removed or changed</p> <p>If true, any sorters attached to this Store will be run after loading data, before the datachanged event is fired. Defaults to true, igored if <a href="#!/api/Ext.data.Store-cfg-remoteSort" rel="Ext.data.Store-cfg-remoteSort" class="docClass">remoteSort</a> is true</p> <p>The property in each item that contains the data to sort.</p> <p>The collection of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Sorters</a> currently applied to this Store</p> <p>Adds Model instance to the Store. This method accepts either:</p> <ul> <li>An array of Model instances or Model configuration objects.</li> <li>Any number of Model instance or Model configuration object arguments.</li> </ul> <p>The new Model instances will be added at the end of the existing collection.</p> <p>Sample usage:</p> <pre><code>myStore.add({some: 'data'}, {some: 'other data'}); </code></pre> <p>Note that if this Store is sorted, the new Model instances will be inserted at the correct point in the Store to maintain the sort order.</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>(Local sort only) Inserts the passed Record into the Store at the index where it should go based on the current sort information.</p> <p>Runs the aggregate function for all the records in the store.</p> <p>Gets the average value in the store.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Revert to a view of the Record cache with no filtering applied.</p> <p>Clear any groupers in the store</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Collects unique values for a particular dataIndex from this store.</p> <p>Commit all Records with <a href="#!/api/Ext.data.Store-method-getModifiedRecords" rel="Ext.data.Store-method-getModifiedRecords" class="docClass">outstanding changes</a>. To handle updates for changes, subscribe to the Store's <a href="#!/api/Ext.data.Store-event-update" rel="Ext.data.Store-event-update" class="docClass">update event</a>, and perform updating when the third parameter is Ext.data.Record.COMMIT.</p> <p>Gets the count of items in the store.</p> <p>Calls the specified function for each of the <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Records</a> in the cache.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Filters the loaded set of records by a given set of filters.</p> <p>Filtering by single field:</p> <pre><code>store.filter("email", /\.com$/); </code></pre> <p>Using multiple filters:</p> <pre><code>store.filter([ {property: "email", value: /\.com$/}, {filterFn: function(item) { return item.get("age") &gt; 10; }} ]); </code></pre> <p>Using <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a> instances instead of config objects (note that we need to specify the <a href="#!/api/Ext.util.Filter-cfg-root" rel="Ext.util.Filter-cfg-root" class="docClass">root</a> config option in this case):</p> <pre><code>store.filter([ <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a>', {property: "email", value: /\.com$/, root: 'data'}), <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a>', {filterFn: function(item) { return item.get("age") &gt; 10; }, root: 'data'}) ]); </code></pre> <p>Filter by a function. The specified function will be called for each Record in this Store. If the function returns <tt>true</tt> the Record is included, otherwise it is filtered out.</p> <p>Finds the index of the first matching Record in this store by a specific field value.</p> <p>Find the index of the first matching Record in this Store by a function. If the function returns <tt>true</tt> it is considered a match.</p> <p>Finds the index of the first matching Record in this store by a specific field value.</p> <p>Finds the first matching Record in this store by a specific field value.</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Convenience function for getting the first model instance in the store</p> <p>Returns a comparator function which compares two items and returns -1, 0, or 1 depending on the currently defined set of <a href="#!/api/Ext.util.Sortable-property-sorters" rel="Ext.util.Sortable-property-sorters" class="docClass">sorters</a>.</p> <p>If there are no <a href="#!/api/Ext.util.Sortable-property-sorters" rel="Ext.util.Sortable-property-sorters" class="docClass">sorters</a> defined, it returns a function which returns <code>0</code> meaning that no sorting will occur.</p> <p>Get the Record at the specified index.</p> <p>Get the Record with the specified id.</p> <p>Gets the number of cached records.</p> <p>If using paging, this may not be the total size of the dataset. If the data object used by the Reader contains the dataset size, then the <a href="#!/api/Ext.data.Store-method-getTotalCount" rel="Ext.data.Store-method-getTotalCount" class="docClass">getTotalCount</a> function returns the dataset size. <b>Note</b>: see the Important note in <a href="#!/api/Ext.data.Store-method-load" rel="Ext.data.Store-method-load" class="docClass">load</a>.</p> <p>Returns the string to group on for a given model instance. The default implementation of this method returns the model's <a href="#!/api/Ext.data.Store-cfg-groupField" rel="Ext.data.Store-cfg-groupField" class="docClass">groupField</a>, but this can be overridden to group by an arbitrary string. For example, to group by the first letter of a model's 'name' field, use the following code:</p> <pre><code> <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>', { groupDir: 'ASC', getGroupString: function(instance) { return instance.get('name')[0]; } }); </code></pre> <p>Returns an array containing the result of applying grouping to the records in this store. See <a href="#!/api/Ext.data.Store-cfg-groupField" rel="Ext.data.Store-cfg-groupField" class="docClass">groupField</a>, <a href="#!/api/Ext.data.Store-cfg-groupDir" rel="Ext.data.Store-cfg-groupDir" class="docClass">groupDir</a> and <a href="#!/api/Ext.data.Store-method-getGroupString" rel="Ext.data.Store-method-getGroupString" class="docClass">getGroupString</a>. Example for a store containing records with a color field:</p> <pre><code> var myStore = <a href="#!/api/Ext-method-create" rel="Ext-method-create" class="docClass">Ext.create</a>('<a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>', { groupField: 'color', groupDir : 'DESC' }); myStore.getGroups(); //returns: [ { name: 'yellow', children: [ //all records where the color field is 'yellow' ] }, { name: 'red', children: [ //all records where the color field is 'red' ] } ] </code></pre> <p>Gets all <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">records</a> added or updated since the last commit. Note that the order of records returned is not deterministic and does not indicate the order in which records were modified. Note also that removed records are not included (use <a href="#!/api/Ext.data.AbstractStore-method-getRemovedRecords" rel="Ext.data.AbstractStore-method-getRemovedRecords" class="docClass">getRemovedRecords</a> for that).</p> <p>Returns all Model instances that are either currently a phantom (e.g. have no id), or have an ID but have not yet been saved on this Store (this happens when adding a non-phantom record from another Store into this one)</p> <p>Determines the page from a record index</p> <p>Returns the proxy currently attached to this proxy instance</p> <p>Returns a range of Records between specified indices.</p> <p>Returns any records that have been removed from the store but not yet destroyed on the proxy.</p> <p>Returns the total number of <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Model</a> instances that the <a href="#!/api/Ext.data.proxy.Proxy" rel="Ext.data.proxy.Proxy" class="docClass">Proxy</a> indicates exist. This will usually differ from <a href="#!/api/Ext.data.Store-method-getCount" rel="Ext.data.Store-method-getCount" class="docClass">getCount</a> when using paging - getCount returns the number of records loaded into the Store at the moment, getTotalCount returns the number of records that could be loaded into the Store if the Store contained all data</p> <p>Returns all Model instances that have been updated in the Store but not yet synchronized with the Proxy</p> <p>Group data in the store</p> <p>Guarantee a specific range, this will load the store with a range (that must be the pageSize or smaller) and take care of any loading that may be necessary.</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Returns the number of pending requests out.</p> <p>Get the index within the cache of the passed Record.</p> <p>Get the index within the cache of the Record with the passed id.</p> <p>Get the index within the entire dataset. From 0 to the totalCount.</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Performs initialization of this mixin. Component classes using this mixin should call this method during their own initialization.</p> <p>Inserts Model instances into the Store at the given index and fires the <a href="#!/api/Ext.data.Store-event-add" rel="Ext.data.Store-event-add" class="docClass">add</a> event. See also <code><a href="#!/api/Ext.data.Store-method-add" rel="Ext.data.Store-method-add" class="docClass">add</a></code>.</p> <p>Returns true if this store is currently filtered</p> <p>Checks if the store is currently grouped</p> <p>Returns true if the Store is currently performing a load operation</p> <p>Convenience function for getting the last model instance in the store</p> <p>Loads data into the Store via the configured <a href="#!/api/Ext.data.Store-cfg-proxy" rel="Ext.data.Store-cfg-proxy" class="docClass">proxy</a>. This uses the Proxy to make an asynchronous call to whatever storage backend the Proxy uses, automatically adding the retrieved instances into the Store and calling an optional callback if required. Example usage:</p> <pre><code>store.load({ scope: this, callback: function(records, operation, success) { // the <a href="#!/api/Ext.data.Operation" rel="Ext.data.Operation" class="docClass">operation</a> object // contains all of the details of the load operation console.log(records); } }); </code></pre> <p>If the callback scope does not need to be set, a function can simply be passed:</p> <pre><code>store.load(function(records, operation, success) { console.log('loaded records'); }); </code></pre> <p>Loads an array of data straight into the Store.</p> <p>Using this method is great if the data is in the correct format already (e.g. it doesn't need to be processed by a reader). If your data requires processing to decode the data structure, use a <a href="#!/api/Ext.data.proxy.Memory" rel="Ext.data.proxy.Memory" class="docClass">MemoryProxy</a> instead.</p> <p>Loads a given 'page' of data by setting the start and limit values appropriately. Internally this just causes a normal load operation, passing in calculated 'start' and 'limit' params</p> <p>Loads data via the bound Proxy's reader</p> <p>Use this method if you are attempting to load data and want to utilize the configured data reader.</p> <p>Loads an array of <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">model</a> instances into the store, fires the datachanged event. This should only usually be called internally when loading from the <a href="#!/api/Ext.data.proxy.Proxy" rel="Ext.data.proxy.Proxy" class="docClass">Proxy</a>, when adding records manually use <a href="#!/api/Ext.data.Store-method-add" rel="Ext.data.Store-method-add" class="docClass">add</a> instead</p> <p>Gets the maximum value in the store.</p> <p>Gets the minimum value in the store.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Loads the next 'page' in the current data set</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Prefetches data into the store using its configured <a href="#!/api/Ext.data.Store-cfg-proxy" rel="Ext.data.Store-cfg-proxy" class="docClass">proxy</a>.</p> <p>Prefetches a page of data.</p> <p>Loads the previous 'page' in the current data set</p> <p>Purge the least recently used records in the prefetch if the purgeCount has been exceeded.</p> <p>Query the cached records in this Store using a filtering function. The specified function will be called with each record in this Store. If the function returns <tt>true</tt> the record is included in the results.</p> <p><a href="#!/api/Ext.data.Model-method-reject" rel="Ext.data.Model-method-reject" class="docClass">Reject</a> outstanding changes on all <a href="#!/api/Ext.data.Store-method-getModifiedRecords" rel="Ext.data.Store-method-getModifiedRecords" class="docClass">modified records</a> and re-insert any records that were removed locally. Any phantom records will be removed.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes the given record from the Store, firing the 'remove' event for each instance that is removed, plus a single 'datachanged' event after removal.</p> <p>Remove all items from the store.</p> <p>Removes the model instance at the given index</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes automatically syncing the Store with its Proxy. Only applicable if <a href="#!/api/Ext.data.AbstractStore-cfg-autoSync" rel="Ext.data.AbstractStore-cfg-autoSync" class="docClass">autoSync</a> is <code>true</code></p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Saves all pending changes via the configured <a href="#!/api/Ext.data.AbstractStore-cfg-proxy" rel="Ext.data.AbstractStore-cfg-proxy" class="docClass">proxy</a>. Use <a href="#!/api/Ext.data.AbstractStore-method-sync" rel="Ext.data.AbstractStore-method-sync" class="docClass">sync</a> instead.</p> <p>Sets the Store's Proxy by string, config object or Proxy instance</p> <p>Sorts the data in the Store by one or more of its properties. Example usage:</p> <pre><code>//sort by a single field myStore.sort('myField', 'DESC'); //sorting by multiple fields myStore.sort([ { property : 'age', direction: 'ASC' }, { property : 'name', direction: 'DESC' } ]); </code></pre> <p>Internally, Store converts the passed arguments into an array of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Ext.util.Sorter</a> instances, and delegates the actual sorting to its internal <a href="#!/api/Ext.util.MixedCollection" rel="Ext.util.MixedCollection" class="docClass">Ext.util.MixedCollection</a>.</p> <p>When passing a single string argument to sort, Store maintains a ASC/DESC toggler per field, so this code:</p> <pre><code>store.sort('myField'); store.sort('myField'); </code></pre> <p>Is equivalent to this code, because Store handles the toggling automatically:</p> <pre><code>store.sort('myField', 'ASC'); store.sort('myField', 'DESC'); </code></pre> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Sums the value of <tt>property</tt> for each <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">record</a> between <tt>start</tt> and <tt>end</tt> and returns the result.</p> <p>Suspends automatically syncing the Store with its Proxy. Only applicable if <a href="#!/api/Ext.data.AbstractStore-cfg-autoSync" rel="Ext.data.AbstractStore-cfg-autoSync" class="docClass">autoSync</a> is <code>true</code></p> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Synchronizes the store with its <a href="#!/api/Ext.data.AbstractStore-cfg-proxy" rel="Ext.data.AbstractStore-cfg-proxy" class="docClass">proxy</a>. This asks the proxy to batch together any new, updated and deleted records in the store, updating the store's internal representation of the records as each operation completes.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Creates new Operation object.</p> <p>Config object.</p> <p>The RegExp used to categorize actions that require record commits.</p> <p>The RegExp used to categorize actions that skip local record synchronization. This defaults to match 'destroy'.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Checks whether this operation should cause writing to occur.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>This method is called to commit data to this instance's records given the records in the server response. This is followed by calling <a href="#!/api/Ext.data.Model-method-commit" rel="Ext.data.Model-method-commit" class="docClass">Ext.data.Model.commit</a> on all those records (for 'create' and 'update' actions).</p> <p>If this <a href="#!/api/Ext.data.Operation-cfg-action" rel="Ext.data.Operation-cfg-action" class="docClass">action</a> is 'destroy', any server records are ignored and the <a href="#!/api/Ext.data.Model-method-commit" rel="Ext.data.Model-method-commit" class="docClass">Ext.data.Model.commit</a> method is not called.</p> <p>Returns the error string or object that was set using <a href="#!/api/Ext.data.Operation-method-setException" rel="Ext.data.Operation-method-setException" class="docClass">setException</a></p> <p>Returns the <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">record</a>s associated with this operation. For read operations the records as set by the <a href="#!/api/Ext.data.proxy.Proxy" rel="Ext.data.proxy.Proxy" class="docClass">Proxy</a> will be returned (returns <code>null</code> if the proxy has not yet set the records). For create, update, and destroy operations the operation's initially configured records will be returned, although the proxy may modify these records' data at some point after the operation is initialized.</p> <p>Returns the ResultSet object (if set by the Proxy). This object will contain the <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">model</a> instances as well as meta data such as number of instances fetched, number available etc</p> <p>Returns true if this Operation encountered an exception (see also <a href="#!/api/Ext.data.Operation-method-getError" rel="Ext.data.Operation-method-getError" class="docClass">getError</a>)</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Returns true if the Operation has been completed</p> <p>Returns true if the Operation has been started but has not yet completed.</p> <p>Returns true if the Operation has been started. Note that the Operation may have started AND completed, see <a href="#!/api/Ext.data.Operation-method-isRunning" rel="Ext.data.Operation-method-isRunning" class="docClass">isRunning</a> to test if the Operation is currently running.</p> <p>Marks the Operation as completed.</p> <p>Marks the Operation as having experienced an exception. Can be supplied with an option error message/object.</p> <p>Marks the Operation as started.</p> <p>Marks the Operation as successful.</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Returns true if the Operation has completed and was successful</p> <p>Note that if this HttpProxy is being used by a <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Store</a>, then the Store's call to <a href="#!/api/Ext.data.Store-method-load" rel="Ext.data.Store-method-load" class="docClass">load</a> will override any specified callback and params options. In this case, use the <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Store</a>'s events to modify parameters, or react to loading events.</p> <p>Config object. If an options parameter is passed, the singleton <a href="#!/api/Ext.Ajax" rel="Ext.Ajax" class="docClass">Ext.Ajax</a> object will be used to make the request.</p> <p>Mapping of action name to HTTP request method. In the basic AjaxProxy these are set to 'GET' for 'read' actions and 'POST' for 'create', 'update' and 'destroy' actions. The <a href="#!/api/Ext.data.proxy.Rest" rel="Ext.data.proxy.Rest" class="docClass">Ext.data.proxy.Rest</a> maps these to the correct RESTful methods.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Optional callback function which can be used to clean up after a request has been completed.</p> <p>Performs a batch of <a href="#!/api/Ext.data.Operation" rel="Ext.data.Operation" class="docClass">Operations</a>, in the order specified by <a href="#!/api/Ext.data.proxy.Proxy-cfg-batchOrder" rel="Ext.data.proxy.Proxy-cfg-batchOrder" class="docClass">batchOrder</a>. Used internally by <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>'s <a href="#!/api/Ext.data.Store-method-sync" rel="Ext.data.Store-method-sync" class="docClass">sync</a> method. Example usage:</p> <pre><code>myProxy.batch({ create : [myModel1, myModel2], update : [myModel3], destroy: [myModel4, myModel5] }); </code></pre> <p>Where the myModel* above are <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Model</a> instances - in this case 1 and 2 are new instances and have not been saved before, 3 has been saved previously but needs to be updated, and 4 and 5 have already been saved but should now be destroyed.</p> <p>Note that the previous version of this method took 2 arguments (operations and listeners). While this is still supported for now, the current signature is now a single <code>options</code> argument that can contain both operations and listeners, in addition to other options. The multi-argument signature will likely be deprecated in a future release.</p> <p>Creates and returns an <a href="#!/api/Ext.data.Request" rel="Ext.data.Request" class="docClass">Ext.data.Request</a> object based on the options passed by the <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Store</a> that this Proxy is attached to.</p> <p>Generates a url based on a given <a href="#!/api/Ext.data.Request" rel="Ext.data.Request" class="docClass">Ext.data.Request</a> object. By default, ServerProxy's buildUrl will add the cache-buster param to the end of the url. Subclasses may need to perform additional modifications to the url.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Performs the given create operation.</p> <p>Performs the given destroy operation.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Encodes the array of <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a> objects into a string to be sent in the request url. By default, this simply JSON-encodes the filter data</p> <p>Encodes the array of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Ext.util.Sorter</a> objects into a string to be sent in the request url. By default, this simply JSON-encodes the sorter data</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Returns the HTTP method name for a given request. By default this returns based on a lookup on <a href="#!/api/Ext.data.proxy.Ajax-property-actionMethods" rel="Ext.data.proxy.Ajax-property-actionMethods" class="docClass">actionMethods</a>.</p> <p>Returns the model attached to this Proxy</p> <p>Returns the reader currently attached to this proxy instance</p> <p>Returns the writer currently attached to this proxy instance</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Performs the given read operation.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Sets a value in the underlying <a href="#!/api/Ext.data.proxy.Server-cfg-extraParams" rel="Ext.data.proxy.Server-cfg-extraParams" class="docClass">extraParams</a>.</p> <p>Sets the model associated with this proxy. This will only usually be called by a Store</p> <p>Sets the Proxy's Reader by string, config object or Reader instance</p> <p>Sets the Proxy's Writer by string, config object or Writer instance</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Performs the given update operation.</p> <p>Creates the Proxy</p> <p>Config object.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Performs a batch of <a href="#!/api/Ext.data.Operation" rel="Ext.data.Operation" class="docClass">Operations</a>, in the order specified by <a href="#!/api/Ext.data.proxy.Proxy-cfg-batchOrder" rel="Ext.data.proxy.Proxy-cfg-batchOrder" class="docClass">batchOrder</a>. Used internally by <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>'s <a href="#!/api/Ext.data.Store-method-sync" rel="Ext.data.Store-method-sync" class="docClass">sync</a> method. Example usage:</p> <pre><code>myProxy.batch({ create : [myModel1, myModel2], update : [myModel3], destroy: [myModel4, myModel5] }); </code></pre> <p>Where the myModel* above are <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Model</a> instances - in this case 1 and 2 are new instances and have not been saved before, 3 has been saved previously but needs to be updated, and 4 and 5 have already been saved but should now be destroyed.</p> <p>Note that the previous version of this method took 2 arguments (operations and listeners). While this is still supported for now, the current signature is now a single <code>options</code> argument that can contain both operations and listeners, in addition to other options. The multi-argument signature will likely be deprecated in a future release.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Abstract function that must be implemented by each ClientProxy subclass. This should purge all record data from the client side storage, as well as removing any supporting data (such as lists of record IDs)</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Performs the given create operation.</p> <p>Performs the given destroy operation.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Returns the model attached to this Proxy</p> <p>Returns the reader currently attached to this proxy instance</p> <p>Returns the writer currently attached to this proxy instance</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Performs the given read operation.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Sets the model associated with this proxy. This will only usually be called by a Store</p> <p>Sets the Proxy's Reader by string, config object or Reader instance</p> <p>Sets the Proxy's Writer by string, config object or Writer instance</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Performs the given update operation.</p> <p>Creates the Proxy</p> <p>Config object.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Optional callback function which can be used to clean up after a request has been completed.</p> <p>Performs a batch of <a href="#!/api/Ext.data.Operation" rel="Ext.data.Operation" class="docClass">Operations</a>, in the order specified by <a href="#!/api/Ext.data.proxy.Proxy-cfg-batchOrder" rel="Ext.data.proxy.Proxy-cfg-batchOrder" class="docClass">batchOrder</a>. Used internally by <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>'s <a href="#!/api/Ext.data.Store-method-sync" rel="Ext.data.Store-method-sync" class="docClass">sync</a> method. Example usage:</p> <pre><code>myProxy.batch({ create : [myModel1, myModel2], update : [myModel3], destroy: [myModel4, myModel5] }); </code></pre> <p>Where the myModel* above are <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Model</a> instances - in this case 1 and 2 are new instances and have not been saved before, 3 has been saved previously but needs to be updated, and 4 and 5 have already been saved but should now be destroyed.</p> <p>Note that the previous version of this method took 2 arguments (operations and listeners). While this is still supported for now, the current signature is now a single <code>options</code> argument that can contain both operations and listeners, in addition to other options. The multi-argument signature will likely be deprecated in a future release.</p> <p>Creates and returns an <a href="#!/api/Ext.data.Request" rel="Ext.data.Request" class="docClass">Ext.data.Request</a> object based on the options passed by the <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Store</a> that this Proxy is attached to.</p> <p>Generates a url based on a given <a href="#!/api/Ext.data.Request" rel="Ext.data.Request" class="docClass">Ext.data.Request</a> object. By default, ServerProxy's buildUrl will add the cache-buster param to the end of the url. Subclasses may need to perform additional modifications to the url.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Performs the given create operation.</p> <p>Performs the given destroy operation.</p> <p>In ServerProxy subclasses, the <a href="#!/api/Ext.data.proxy.Server-method-create" rel="Ext.data.proxy.Server-method-create" class="docClass">create</a>, <a href="#!/api/Ext.data.proxy.Server-method-read" rel="Ext.data.proxy.Server-method-read" class="docClass">read</a>, <a href="#!/api/Ext.data.proxy.Server-method-update" rel="Ext.data.proxy.Server-method-update" class="docClass">update</a> and <a href="#!/api/Ext.data.proxy.Server-method-destroy" rel="Ext.data.proxy.Server-method-destroy" class="docClass">destroy</a> methods all pass through to doRequest. Each ServerProxy subclass must implement the doRequest method - see <a href="#!/api/Ext.data.proxy.JsonP" rel="Ext.data.proxy.JsonP" class="docClass">Ext.data.proxy.JsonP</a> and <a href="#!/api/Ext.data.proxy.Ajax" rel="Ext.data.proxy.Ajax" class="docClass">Ext.data.proxy.Ajax</a> for examples. This method carries the same signature as each of the methods that delegate to it.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Encodes the array of <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a> objects into a string to be sent in the request url. By default, this simply JSON-encodes the filter data</p> <p>Encodes the array of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Ext.util.Sorter</a> objects into a string to be sent in the request url. By default, this simply JSON-encodes the sorter data</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Returns the model attached to this Proxy</p> <p>Returns the reader currently attached to this proxy instance</p> <p>Returns the writer currently attached to this proxy instance</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Performs the given read operation.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Sets a value in the underlying <a href="#!/api/Ext.data.proxy.Server-cfg-extraParams" rel="Ext.data.proxy.Server-cfg-extraParams" class="docClass">extraParams</a>.</p> <p>Sets the model associated with this proxy. This will only usually be called by a Store</p> <p>Sets the Proxy's Reader by string, config object or Reader instance</p> <p>Sets the Proxy's Writer by string, config object or Writer instance</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Performs the given update operation.</p> <p>Creates the Proxy</p> <p>Config object.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Aborts the current server request if one is currently running</p> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Optional callback function which can be used to clean up after a request has been completed.</p> <p>Performs a batch of <a href="#!/api/Ext.data.Operation" rel="Ext.data.Operation" class="docClass">Operations</a>, in the order specified by <a href="#!/api/Ext.data.proxy.Proxy-cfg-batchOrder" rel="Ext.data.proxy.Proxy-cfg-batchOrder" class="docClass">batchOrder</a>. Used internally by <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>'s <a href="#!/api/Ext.data.Store-method-sync" rel="Ext.data.Store-method-sync" class="docClass">sync</a> method. Example usage:</p> <pre><code>myProxy.batch({ create : [myModel1, myModel2], update : [myModel3], destroy: [myModel4, myModel5] }); </code></pre> <p>Where the myModel* above are <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Model</a> instances - in this case 1 and 2 are new instances and have not been saved before, 3 has been saved previously but needs to be updated, and 4 and 5 have already been saved but should now be destroyed.</p> <p>Note that the previous version of this method took 2 arguments (operations and listeners). While this is still supported for now, the current signature is now a single <code>options</code> argument that can contain both operations and listeners, in addition to other options. The multi-argument signature will likely be deprecated in a future release.</p> <p>Creates and returns an <a href="#!/api/Ext.data.Request" rel="Ext.data.Request" class="docClass">Ext.data.Request</a> object based on the options passed by the <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Store</a> that this Proxy is attached to.</p> <p>Generates a url based on a given <a href="#!/api/Ext.data.Request" rel="Ext.data.Request" class="docClass">Ext.data.Request</a> object. Adds the params and callback function name to the url</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Performs the given create operation.</p> <p>Performs the given destroy operation.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Encodes the array of <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a> objects into a string to be sent in the request url. By default, this simply JSON-encodes the filter data</p> <p>Encodes an array of records into a string suitable to be appended to the script src url. This is broken out into its own function so that it can be easily overridden.</p> <p>Encodes the array of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Ext.util.Sorter</a> objects into a string to be sent in the request url. By default, this simply JSON-encodes the sorter data</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Returns the model attached to this Proxy</p> <p>Returns the reader currently attached to this proxy instance</p> <p>Returns the writer currently attached to this proxy instance</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Performs the given read operation.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Sets a value in the underlying <a href="#!/api/Ext.data.proxy.Server-cfg-extraParams" rel="Ext.data.proxy.Server-cfg-extraParams" class="docClass">extraParams</a>.</p> <p>Sets the model associated with this proxy. This will only usually be called by a Store</p> <p>Sets the Proxy's Reader by string, config object or Reader instance</p> <p>Sets the Proxy's Writer by string, config object or Writer instance</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Performs the given update operation.</p> <p>Creates the proxy, throws an error if local storage is not supported in the current browser.</p> <p>Config object.</p> <p>Cached map of records already retrieved by this Proxy. Ensures that the same instance is always retrieved.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Performs a batch of <a href="#!/api/Ext.data.Operation" rel="Ext.data.Operation" class="docClass">Operations</a>, in the order specified by <a href="#!/api/Ext.data.proxy.Proxy-cfg-batchOrder" rel="Ext.data.proxy.Proxy-cfg-batchOrder" class="docClass">batchOrder</a>. Used internally by <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>'s <a href="#!/api/Ext.data.Store-method-sync" rel="Ext.data.Store-method-sync" class="docClass">sync</a> method. Example usage:</p> <pre><code>myProxy.batch({ create : [myModel1, myModel2], update : [myModel3], destroy: [myModel4, myModel5] }); </code></pre> <p>Where the myModel* above are <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Model</a> instances - in this case 1 and 2 are new instances and have not been saved before, 3 has been saved previously but needs to be updated, and 4 and 5 have already been saved but should now be destroyed.</p> <p>Note that the previous version of this method took 2 arguments (operations and listeners). While this is still supported for now, the current signature is now a single <code>options</code> argument that can contain both operations and listeners, in addition to other options. The multi-argument signature will likely be deprecated in a future release.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Destroys all records stored in the proxy and removes all keys and values used to support the proxy from the storage object.</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Performs the given create operation.</p> <p>Performs the given destroy operation.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Returns the model attached to this Proxy</p> <p>Returns the reader currently attached to this proxy instance</p> <p>Returns the writer currently attached to this proxy instance</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Performs the given read operation.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Sets the model associated with this proxy. This will only usually be called by a Store</p> <p>Sets the Proxy's Reader by string, config object or Reader instance</p> <p>Saves the given record in the Proxy.</p> <p>Sets the Proxy's Writer by string, config object or Writer instance</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Performs the given update operation.</p> <p>Creates the Proxy</p> <p>Config object.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Performs a batch of <a href="#!/api/Ext.data.Operation" rel="Ext.data.Operation" class="docClass">Operations</a>, in the order specified by <a href="#!/api/Ext.data.proxy.Proxy-cfg-batchOrder" rel="Ext.data.proxy.Proxy-cfg-batchOrder" class="docClass">batchOrder</a>. Used internally by <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>'s <a href="#!/api/Ext.data.Store-method-sync" rel="Ext.data.Store-method-sync" class="docClass">sync</a> method. Example usage:</p> <pre><code>myProxy.batch({ create : [myModel1, myModel2], update : [myModel3], destroy: [myModel4, myModel5] }); </code></pre> <p>Where the myModel* above are <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Model</a> instances - in this case 1 and 2 are new instances and have not been saved before, 3 has been saved previously but needs to be updated, and 4 and 5 have already been saved but should now be destroyed.</p> <p>Note that the previous version of this method took 2 arguments (operations and listeners). While this is still supported for now, the current signature is now a single <code>options</code> argument that can contain both operations and listeners, in addition to other options. The multi-argument signature will likely be deprecated in a future release.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Abstract function that must be implemented by each ClientProxy subclass. This should purge all record data from the client side storage, as well as removing any supporting data (such as lists of record IDs)</p> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Currently this is a hard-coded method that simply commits any records and sets the operation to successful, then calls the callback function, if provided. It is essentially mocking a server call in memory, but since there is no real back end in this case there's not much else to do. This method can be easily overridden to implement more complex logic if needed.</p> <p>Currently this is a hard-coded method that simply commits any records and sets the operation to successful, then calls the callback function, if provided. It is essentially mocking a server call in memory, but since there is no real back end in this case there's not much else to do. This method can be easily overridden to implement more complex logic if needed.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Returns the model attached to this Proxy</p> <p>Returns the reader currently attached to this proxy instance</p> <p>Returns the writer currently attached to this proxy instance</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Reads data from the configured <a href="#!/api/Ext.data.proxy.Memory-cfg-data" rel="Ext.data.proxy.Memory-cfg-data" class="docClass">data</a> object. Uses the Proxy's <a href="#!/api/Ext.data.proxy.Memory-cfg-reader" rel="Ext.data.proxy.Memory-cfg-reader" class="docClass">reader</a>, if present.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Sets the model associated with this proxy. This will only usually be called by a Store</p> <p>Sets the Proxy's Reader by string, config object or Reader instance</p> <p>Sets the Proxy's Writer by string, config object or Writer instance</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Currently this is a hard-coded method that simply commits any records and sets the operation to successful, then calls the callback function, if provided. It is essentially mocking a server call in memory, but since there is no real back end in this case there's not much else to do. This method can be easily overridden to implement more complex logic if needed.</p> <p>Creates the Proxy</p> <p>Config object.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Performs a batch of <a href="#!/api/Ext.data.Operation" rel="Ext.data.Operation" class="docClass">Operations</a>, in the order specified by <a href="#!/api/Ext.data.proxy.Proxy-cfg-batchOrder" rel="Ext.data.proxy.Proxy-cfg-batchOrder" class="docClass">batchOrder</a>. Used internally by <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>'s <a href="#!/api/Ext.data.Store-method-sync" rel="Ext.data.Store-method-sync" class="docClass">sync</a> method. Example usage:</p> <pre><code>myProxy.batch({ create : [myModel1, myModel2], update : [myModel3], destroy: [myModel4, myModel5] }); </code></pre> <p>Where the myModel* above are <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Model</a> instances - in this case 1 and 2 are new instances and have not been saved before, 3 has been saved previously but needs to be updated, and 4 and 5 have already been saved but should now be destroyed.</p> <p>Note that the previous version of this method took 2 arguments (operations and listeners). While this is still supported for now, the current signature is now a single <code>options</code> argument that can contain both operations and listeners, in addition to other options. The multi-argument signature will likely be deprecated in a future release.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Performs the given create operation.</p> <p>Performs the given destroy operation.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Returns the model attached to this Proxy</p> <p>Returns the reader currently attached to this proxy instance</p> <p>Returns the writer currently attached to this proxy instance</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Performs the given read operation.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Sets the model associated with this proxy. This will only usually be called by a Store</p> <p>Sets the Proxy's Reader by string, config object or Reader instance</p> <p>Sets the Proxy's Writer by string, config object or Writer instance</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Performs the given update operation.</p> <p>Note that if this HttpProxy is being used by a <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Store</a>, then the Store's call to <a href="#!/api/Ext.data.Store-method-load" rel="Ext.data.Store-method-load" class="docClass">load</a> will override any specified callback and params options. In this case, use the <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Store</a>'s events to modify parameters, or react to loading events.</p> <p>Config object. If an options parameter is passed, the singleton <a href="#!/api/Ext.Ajax" rel="Ext.Ajax" class="docClass">Ext.Ajax</a> object will be used to make the request.</p> <p>Mapping of action name to HTTP request method. These default to RESTful conventions for the 'create', 'read', 'update' and 'destroy' actions (which map to 'POST', 'GET', 'PUT' and 'DELETE' respectively). This object should not be changed except globally via <a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a> - the <a href="#!/api/Ext.data.proxy.Rest-method-getMethod" rel="Ext.data.proxy.Rest-method-getMethod" class="docClass">getMethod</a> function can be overridden instead.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Optional callback function which can be used to clean up after a request has been completed.</p> <p>Performs a batch of <a href="#!/api/Ext.data.Operation" rel="Ext.data.Operation" class="docClass">Operations</a>, in the order specified by <a href="#!/api/Ext.data.proxy.Proxy-cfg-batchOrder" rel="Ext.data.proxy.Proxy-cfg-batchOrder" class="docClass">batchOrder</a>. Used internally by <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>'s <a href="#!/api/Ext.data.Store-method-sync" rel="Ext.data.Store-method-sync" class="docClass">sync</a> method. Example usage:</p> <pre><code>myProxy.batch({ create : [myModel1, myModel2], update : [myModel3], destroy: [myModel4, myModel5] }); </code></pre> <p>Where the myModel* above are <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Model</a> instances - in this case 1 and 2 are new instances and have not been saved before, 3 has been saved previously but needs to be updated, and 4 and 5 have already been saved but should now be destroyed.</p> <p>Note that the previous version of this method took 2 arguments (operations and listeners). While this is still supported for now, the current signature is now a single <code>options</code> argument that can contain both operations and listeners, in addition to other options. The multi-argument signature will likely be deprecated in a future release.</p> <p>Creates and returns an <a href="#!/api/Ext.data.Request" rel="Ext.data.Request" class="docClass">Ext.data.Request</a> object based on the options passed by the <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Store</a> that this Proxy is attached to.</p> <p>Specialized version of buildUrl that incorporates the <a href="#!/api/Ext.data.proxy.Rest-cfg-appendId" rel="Ext.data.proxy.Rest-cfg-appendId" class="docClass">appendId</a> and <a href="#!/api/Ext.data.proxy.Rest-cfg-format" rel="Ext.data.proxy.Rest-cfg-format" class="docClass">format</a> options into the generated url. Override this to provide further customizations, but remember to call the superclass buildUrl so that additional parameters like the cache buster string are appended.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Performs the given create operation.</p> <p>Performs the given destroy operation.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Encodes the array of <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a> objects into a string to be sent in the request url. By default, this simply JSON-encodes the filter data</p> <p>Encodes the array of <a href="#!/api/Ext.util.Sorter" rel="Ext.util.Sorter" class="docClass">Ext.util.Sorter</a> objects into a string to be sent in the request url. By default, this simply JSON-encodes the sorter data</p> <p>Fires the specified event with the passed parameters (minus the event name, plus the <code>options</code> object passed to <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>).</p> <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>) by calling <a href="#!/api/Ext.util.Observable-method-enableBubble" rel="Ext.util.Observable-method-enableBubble" class="docClass">enableBubble</a>.</p> <p>Returns the HTTP method name for a given request. By default this returns based on a lookup on <a href="#!/api/Ext.data.proxy.Ajax-property-actionMethods" rel="Ext.data.proxy.Ajax-property-actionMethods" class="docClass">actionMethods</a>.</p> <p>Returns the model attached to this Proxy</p> <p>Returns the reader currently attached to this proxy instance</p> <p>Returns the writer currently attached to this proxy instance</p> <p>Checks to see if this object has any listeners for a specified event</p> <p>Initialize configuration for this class. a typical example:</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.awesome.Class', { // The default config config: { name: 'Awesome', isAwesome: true }, constructor: function(config) { this.initConfig(config); } }); var awesome = new My.awesome.Class({ name: 'Super Awesome' }); alert(awesome.getName()); // 'Super Awesome' </code></pre> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addManagedListener" rel="Ext.util.Observable-method-addManagedListener" class="docClass">addManagedListener</a>.</p> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeManagedListener" rel="Ext.util.Observable-method-removeManagedListener" class="docClass">removeManagedListener</a>.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-addListener" rel="Ext.util.Observable-method-addListener" class="docClass">addListener</a>.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Performs the given read operation.</p> <p>Relays selected events from the specified Observable as if the events were fired by <code>this</code>.</p> <p>For example if you are extending Grid, you might decide to forward some events from store. So you can do this inside your initComponent:</p> <pre><code>this.relayEvents(this.getStore(), ['load']); </code></pre> <p>The grid instance will then have an observable 'load' event which will be passed the parameters of the store's load event and any function fired with the grid's load event would have access to the grid using the <code>this</code> keyword.</p> <p>Removes an event handler.</p> <p>Removes listeners that were added by the <a href="#!/api/Ext.util.Observable-method-mon" rel="Ext.util.Observable-method-mon" class="docClass">mon</a> method.</p> <p>Resumes firing events (see <a href="#!/api/Ext.util.Observable-method-suspendEvents" rel="Ext.util.Observable-method-suspendEvents" class="docClass">suspendEvents</a>).</p> <p>If events were suspended using the <code>queueSuspended</code> parameter, then all events fired during event suspension will be sent to any listeners now.</p> <p>Sets a value in the underlying <a href="#!/api/Ext.data.proxy.Server-cfg-extraParams" rel="Ext.data.proxy.Server-cfg-extraParams" class="docClass">extraParams</a>.</p> <p>Sets the model associated with this proxy. This will only usually be called by a Store</p> <p>Sets the Proxy's Reader by string, config object or Reader instance</p> <p>Sets the Proxy's Writer by string, config object or Writer instance</p> <p>Get the reference to the class from which this object was instantiated. Note that unlike <a href="#!/api/Ext.Base-property-self" rel="Ext.Base-property-self" class="docClass">self</a>, <code>this.statics()</code> is scope-independent and it always returns the class from which it was called, regardless of what <code>this</code> points to during run-time</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { totalCreated: 0, speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { var statics = this.statics(); alert(statics.speciesName); // always equals to 'Cat' no matter what 'this' refers to // equivalent to: My.Cat.speciesName alert(this.self.speciesName); // dependent on 'this' statics.totalCreated++; }, clone: function() { var cloned = new this.self; // dependent on 'this' cloned.groupName = this.statics().speciesName; // equivalent to: My.Cat.speciesName return cloned; } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' }, constructor: function() { this.callParent(); } }); var cat = new My.Cat(); // alerts 'Cat', then alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' alert(clone.groupName); // alerts 'Cat' alert(My.Cat.totalCreated); // alerts 3 </code></pre> <p>Suspends the firing of all events. (see <a href="#!/api/Ext.util.Observable-method-resumeEvents" rel="Ext.util.Observable-method-resumeEvents" class="docClass">resumeEvents</a>)</p> <p>Shorthand for <a href="#!/api/Ext.util.Observable-method-removeListener" rel="Ext.util.Observable-method-removeListener" class="docClass">removeListener</a>.</p> <p>Removes an event handler.</p> <p>Performs the given update operation.</p> <p>Creates the Proxy</p> <p>Config object.</p> <p>Get the reference to the current class from which this object was instantiated. Unlike <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a>, <code>this.self</code> is scope-dependent and it's meant to be used for dynamic inheritance. See <a href="#!/api/Ext.Base-method-statics" rel="Ext.Base-method-statics" class="docClass">statics</a> for a detailed comparison</p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { statics: { speciesName: 'Cat' // My.Cat.speciesName = 'Cat' }, constructor: function() { alert(this.self.speciesName); / dependentOL on 'this' }, clone: function() { return new this.self(); } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.SnowLeopard', { extend: 'My.Cat', statics: { speciesName: 'Snow Leopard' // My.SnowLeopard.speciesName = 'Snow Leopard' } }); var cat = new My.Cat(); // alerts 'Cat' var snowLeopard = new My.SnowLeopard(); // alerts 'Snow Leopard' var clone = snowLeopard.clone(); alert(<a href="#!/api/Ext-method-getClassName" rel="Ext-method-getClassName" class="docClass">Ext.getClassName</a>(clone)); // alerts 'My.SnowLeopard' </code></pre> <p>Adds the specified events to the list of events which this Observable may fire.</p> <p>Appends an event handler to this object. For example:</p> <pre><code>myGridPanel.on("mouseover", this.onMouseOver, this); </code></pre> <p>The method also allows for a single argument to be passed which is a config object containing properties which specify multiple events. For example:</p> <pre><code>myGridPanel.on({ cellClick: this.onCellClick, mouseover: this.onMouseOver, mouseout: this.onMouseOut, scope: this // Important. Ensure "this" is correct during handler execution }); </code></pre> <p>One can also specify options for each event handler separately:</p> <pre><code>myGridPanel.on({ cellClick: {fn: this.onCellClick, scope: this, single: true}, mouseover: {fn: panel.onMouseOver, scope: panel} }); </code></pre> <p>Adds listeners to any Observable object (or <a href="#!/api/Ext.dom.Element" rel="Ext.dom.Element" class="docClass">Ext.Element</a>) which are automatically removed when this Component is destroyed.</p> <p>Optional callback function which can be used to clean up after a request has been completed.</p> <p>Performs a batch of <a href="#!/api/Ext.data.Operation" rel="Ext.data.Operation" class="docClass">Operations</a>, in the order specified by <a href="#!/api/Ext.data.proxy.Proxy-cfg-batchOrder" rel="Ext.data.proxy.Proxy-cfg-batchOrder" class="docClass">batchOrder</a>. Used internally by <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Ext.data.Store</a>'s <a href="#!/api/Ext.data.Store-method-sync" rel="Ext.data.Store-method-sync" class="docClass">sync</a> method. Example usage:</p> <pre><code>myProxy.batch({ create : [myModel1, myModel2], update : [myModel3], destroy: [myModel4, myModel5] }); </code></pre> <p>Where the myModel* above are <a href="#!/api/Ext.data.Model" rel="Ext.data.Model" class="docClass">Model</a> instances - in this case 1 and 2 are new instances and have not been saved before, 3 has been saved previously but needs to be updated, and 4 and 5 have already been saved but should now be destroyed.</p> <p>Note that the previous version of this method took 2 arguments (operations and listeners). While this is still supported for now, the current signature is now a single <code>options</code> argument that can contain both operations and listeners, in addition to other options. The multi-argument signature will likely be deprecated in a future release.</p> <p>Creates and returns an <a href="#!/api/Ext.data.Request" rel="Ext.data.Request" class="docClass">Ext.data.Request</a> object based on the options passed by the <a href="#!/api/Ext.data.Store" rel="Ext.data.Store" class="docClass">Store</a> that this Proxy is attached to.</p> <p>Generates a url based on a given <a href="#!/api/Ext.data.Request" rel="Ext.data.Request" class="docClass">Ext.data.Request</a> object. By default, ServerProxy's buildUrl will add the cache-buster param to the end of the url. Subclasses may need to perform additional modifications to the url.</p> <p>Call the original method that was previously overridden with <a href="#!/api/Ext.Base-static-method-override" rel="Ext.Base-static-method-override" class="docClass">override</a></p> <pre><code><a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Cat', { constructor: function() { alert("I'm a cat!"); } }); My.Cat.override({ constructor: function() { alert("I'm going to be a cat!"); var instance = this.callOverridden(); alert("Meeeeoooowwww"); return instance; } }); var kitty = new My.Cat(); // alerts "I'm going to be a cat!" // alerts "I'm a cat!" // alerts "Meeeeoooowwww" </code></pre> <p>Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>).</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Base', { constructor: function (x) { this.x = x; }, statics: { method: function (x) { return x; } } }); <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived', { extend: 'My.Base', constructor: function () { this.callParent([21]); } }); var obj = new My.Derived(); alert(obj.x); // alerts 21 </code></pre> <p>This can be used with an override as follows:</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.DerivedOverride', { override: 'My.Derived', constructor: function (x) { this.callParent([x*2]); // calls original My.Derived constructor } }); var obj = new My.Derived(); alert(obj.x); // now alerts 42 </code></pre> <p>This also works with static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2', { extend: 'My.Base', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Base.method } } }); alert(My.Base.method(10); // alerts 10 alert(My.Derived2.method(10); // alerts 20 </code></pre> <p>Lastly, it also works with overridden static methods.</p> <pre><code> <a href="#!/api/Ext-method-define" rel="Ext-method-define" class="docClass">Ext.define</a>('My.Derived2Override', { override: 'My.Derived2', statics: { method: function (x) { return this.callParent([x*2]); // calls My.Derived2.method } } }); alert(My.Derived2.method(10); // now alerts 40 </code></pre> <p>Removes all listeners for this object including the managed listeners</p> <p>Removes all managed listeners for this object.</p> <p>Performs the given create operation.</p> <p>Performs the given destroy operation.</p> <p>In ServerProxy subclasses, the <a href="#!/api/Ext.data.proxy.Server-method-create" rel="Ext.data.proxy.Server-method-create" class="docClass">create</a>, <a href="#!/api/Ext.data.proxy.Server-method-read" rel="Ext.data.proxy.Server-method-read" class="docClass">read</a>, <a href="#!/api/Ext.data.proxy.Server-method-update" rel="Ext.data.proxy.Server-method-update" class="docClass">update</a> and <a href="#!/api/Ext.data.proxy.Server-method-destroy" rel="Ext.data.proxy.Server-method-destroy" class="docClass">destroy</a> methods all pass through to doRequest. Each ServerProxy subclass must implement the doRequest method - see <a href="#!/api/Ext.data.proxy.JsonP" rel="Ext.data.proxy.JsonP" class="docClass">Ext.data.proxy.JsonP</a> and <a href="#!/api/Ext.data.proxy.Ajax" rel="Ext.data.proxy.Ajax" class="docClass">Ext.data.proxy.Ajax</a> for examples. This method carries the same signature as each of the methods that delegate to it.</p> <p>Enables events fired by this Observable to bubble up an owner hierarchy by calling <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p> <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="#!/api/Ext.Component-method-getBubbleTarget" rel="Ext.Component-method-getBubbleTarget" class="docClass">Ext.Component.getBubbleTarget</a>. The default implementation in <a href="#!/api/Ext.Component" rel="Ext.Component" class="docClass">Ext.Component</a> returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly.</p> <p>Example:</p> <pre><code><a href="#!/api/Ext-method-override" rel="Ext-method-override" class="docClass">Ext.override</a>(<a href="#!/api/Ext.form.field.Base" rel="Ext.form.field.Base" class="docClass">Ext.form.field.Base</a>, { // Add functionality to Field's initComponent to enable the change event to bubble initComponent : <a href="#!/api/Ext.Function-method-createSequence" rel="Ext.Function-method-createSequence" class="docClass">Ext.Function.createSequence</a>(Ext.form.field.Base.prototype.initComponent, function() { this.enableBubble('change'); }), // We know that we want Field's events to bubble directly to the FormPanel. getBubbleTarget : function() { if (!this.formPanel) { this.formPanel = this.findParentByType('form'); } return this.formPanel; } }); var myForm = new Ext.formPanel({ title: 'User Details', items: [{ ... }], listeners: { change: function() { // Title goes red if form has been modified. myForm.header.setStyle('color', 'red'); } } }); </code></pre> <p>Encodes the array of <a href="#!/api/Ext.util.Filter" rel="Ext.util.Filter" class="docClass">Ext.util.Filter</a> objects into a string to be sent in the request url. By default, this simply JSON-encodes the filter data</p> <p>Encodes the array of <a href="#!/api/Ext.util.Sorter" r