Project

General

Profile

EXT.OnReady not called and the buttons are unresponsive

Added by Dinu Ajikutira over 14 years ago

Hi All,

I am trying to get a little confortable with Wt before plunging into porting my project to it. So first attempt, I simply return my original scripts in my application constructor. My scripts use EXTJS, and I create a ViewPort as shown below:

Ext.onReady(function(){

var viewport = new Ext.Viewport({

layout: 'border',

border: false,

items: [

new Ext.Toolbar({

region:'north',

autoEl: {

tag: 'div'},

height:32,

items:[{

xtype: 'tbbutton',

.

.

.

.

.

});

First of all the EXT Ready event is never called, so the viewport is never created. To get over this, I commented out the "Ext.OnReady..." part and then everything looks as expected in the browser. However none of the buttons or panels are responsive. For example, nothing happens if I click on the button (the button is not even clickable). The scroll bars also behave the same. In fact none of the controls do anything.

Do you have any ideas why this could be happening?

Thanks

-Dinu


Replies (2)

RE: EXT.OnReady not called and the buttons are unresponsive - Added by Koen Deforche over 14 years ago

Hey Dinu,

ExtJS has a weird start up sequence, which is not compatible with being loaded dynamically (which is what Wt does unless you enable progressive bootstrap).

To see how we work around this in wtext, consider the code in src/Wt/Ext/Widget.C, initExt(), especially these lines:

    app->doJavaScript("Ext.QuickTips.init();"
              "Ext.BLANK_IMAGE_URL='" + extBaseURL 
              + "resources/images/default/s.gif';", false);

This tricks in ExtJS loading properly.

Regards,

koen

RE: EXT.OnReady not called and the buttons are unresponsive - Added by Dinu Ajikutira over 14 years ago

Hey Koen,

Thanks a lot for the response!! I'll try to get things working...

-Dinu

    (1-2/2)