Sencha Touch launch signal to jQuery
I want to use a jQuery plugin in my Sencha Touch application.
The jQuery plugin should be initialized at startup, but only after Sencha Touch is finished filling the DOM with its magic.
开发者_如何学编程This is because the plugin scans the DOM for certain elements and alters them.
If I use $(document).Ready()
, the <body>
tag is still untouched by Sencha Touch, even when I place the Sencha Touch code above the jQuery code.
What is the best practice way to handle this issue?
You need to tap into EXT's own onReady event.
Ext.setup({
// system-generated set-up code
onReady: function() {
// write your setup code here
}
});
You can also use the painted
event of your view:
config: {
...
listeners:{
painted: function(){
// all the DOM are in place
}
}
}
精彩评论