-
Sencha Premium User
Call Ext.onReady twice
Hi all,
I have a question about Ext.onReady.
My HTML pages are built using different templates (one main template for page header section and many others templates to produce body HTML content for each specific page). In the main (head) template I've my Ext inclusion <script> tags and a call to Ext.onReady to enable common widgets (such as page main menu that is the same for all pages).
Now I'm trying to call Ext.onReady "again" (into the page body templates, it was called in the head section of the document) and apparently seems to work correctly (the result is the "sum" of the execution of the first and second onReady functions).
The question is: is that a "correct" use of Ext.onReady ? Can I call it twice in my javascript code (in the head and then again in body to "add" other initialization functions ?)
Thank you for your time
-
sure you can.
all onReady() does is wait till the DOM is ready, following which it executes the passed function.
if you call onReady() anytime after the DOM is ready, it'll just execute the passed function.
pointless, but harmless.
-
-
Ext JS Premium Member
It is posted a long ago, but I would like to make sure one thing. What happens for the execution order. Sequential order guaranteed ? for example below example will always alert xx first ?
<script>
Ext.onReady(function()
{
alert("xx");
});
</script>
<script>
Ext.onReady(function()
{
alert("yy");
});
</script>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules