Ext onReady function

If you are using Ext Javascript Library, you are probably familar with the Ext.onReady() function. This is where you should put all of your initialzation code. According to the ext api documentation: "Fires when the document is ready (before onload and before images are loaded)." So you use this to ensure that all of the dom elements are loaded and available to the browser. This prevents you from gettting errors by attempting to refernece something the browswer has not loaded. This is really cool. But what happens when you need multiple independant functions to execute when ext is "ready"? For example you have a custom tag that defines a user search control, and you want to place that on any page regardless if there are other ext components on the same page. Well as it turns out, the onReady() function does nothing more than regeister your function to be called when Ext is Ready. This means you can register as many functions to execute when onReady fires. This is really handy as it allows you to seperate your controls and package them up nice and neat as customtags. Think of it this way, it simply creates an array of fucntions to call when the onReady method fires. Since this is an array the order of execution is the order in which the fucntions were added.

Comments
BlogCFC was created by Raymond Camden. This blog is running version 5.9.002. Contact Blog Owner