Thomas Stock
Thomas Stock

Reputation: 11266

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?

Upvotes: 0

Views: 434

Answers (2)

Andr&#233; Herculano
Andr&#233; Herculano

Reputation: 1307

You can also use the painted event of your view:

config: {
  ...

  listeners:{
    painted: function(){
     // all the DOM are in place
    }           
  }
}

Upvotes: 1

Diodeus - James MacFarlane
Diodeus - James MacFarlane

Reputation: 114367

You need to tap into EXT's own onReady event.

Ext.setup({
    // system-generated set-up code
    onReady: function() {
        // write your setup code here
    }
});

Upvotes: 1

Related Questions