Upgrading to Ext 3.0

ljschrenk
ljschrenk's picture
User offline. Last seen 23 weeks 6 min ago. Offline
Joined: 10/13/2008
Points: 82

Greetings,

We want to upgrade our mashlets to use extjs 3.0 instead of the bundled 2.1  In order to do this I set my mashlet to presto_ext:  false in mashlet.json.  Then in the js and css sections I am including the paths to the ext-base, ext-all, and ext-all.css files.  The JS files load perfectly, however the css file will not load.  Here is my code.

"resources" : {
     "libs" : {
           "presto_ext" : false

     },
    "js" : [
        {"script":"http://www.url.com/ext-3.0.0/adapter/ext/ext-base-debug.js"},

{"script":"http://www.url.com/ext-3.0.0/adapter/ext/ext-all-debug.js"},

{"script":"main.js", "property":"myMashlet"},

     ],
    "css" : ["http://www.url.com/ext-3.0.0/resources/css/ext-all.css"]
}

 

If I move the ext-all.css into my mashlet folder it will load, but I don't want a separate local copy because then I have to change all the image paths.  You can set an absolute path for the js files, can you not do this for the css files?

0
Your rating: None
kishores
User offline. Last seen 1 year 4 days ago. Offline
Joined: 09/22/2008
Points: 81

Hi,

This looks like a bug. You should be able to load CSS from an external URL in the same way as you do scripts. I have created a Trouble ticket for this request. For now, please use the workaround which is to copy the CSS files to the Mashlet directory.

thanks,

Kishore

ljschrenk
ljschrenk's picture
User offline. Last seen 23 weeks 6 min ago. Offline
Joined: 10/13/2008
Points: 82

Thanks Kishore.

Can you also help me with what I should put for the property tag when including ext plugins?  From what I understand this is supposed to be the last function in the file so presto knows when the file is done loading. 

 

"resources" : {
     "libs" : {
           "presto_ext" : false

     },
    "js" : [
        {"script":"http://www.url.com/ext-3.0.0/adapter/ext/ext-base-debug.js"},

{"script":"http://www.url.com/ext-3.0.0/adapter/ext/ext-all-debug.js"},
{"script":"Ext.ux.grid.Search.js", "property":"????"},

{"script":"main.js", "property":"myMashlet"},

     ],
    "css" : ["http://www.url.com/ext-3.0.0/resources/css/ext-all.css"]
}

The grid search code can be seen here: http://extjs.com/forum/showthread.php?t=70558

Also do you see any issues with going to ext 3.0 in this way?

ljschrenk
ljschrenk's picture
User offline. Last seen 23 weeks 6 min ago. Offline
Joined: 10/13/2008
Points: 82

The reason I am asking about this is because I cannot load the mashlet in IE... I am told that the property tag is necessary for IE so I assume this is the cause. 

smitchell
smitchell's picture
User offline. Last seen 2 weeks 5 days ago. Offline
Joined: 08/29/2008
Points: 34

Typically, the answer is either the last global function (unlikely in Ext) or the last class constructor in the file. Or it could be a class constructor that you know your code is dependent on. I don't have any direct experience, so I'm not sure if that answer helps or not.

Sara, technical writer/jackbe

 

jeremy.pitten
jeremy.pitten's picture
User offline. Last seen 5 weeks 3 days ago. Offline
Joined: 09/22/2008
Points: 275

You should be able to use "Ext.ux.grid.Search" as the property value, it just needs to be some globally scoped variable that is uniquely defined by the file being loaded.

ljschrenk
ljschrenk's picture
User offline. Last seen 23 weeks 6 min ago. Offline
Joined: 10/13/2008
Points: 82

Ok I think I got it working now.  Seems to load in IE, FF2, and FF3.  Thanks!

Americo Savinon
Americo Savinon's picture
User offline. Last seen 3 weeks 2 days ago. Offline
Joined: 09/19/2008
Points: 187

Here is a mashlet snippet code that loads Ext3.0 from the CDN: CacheFly, its pretty fast and reliable.

(The only drawback is that as Kishore mentioned, the css property has a bug and though you can not load the ext-all.css from the url: http://extjs.cachefly.net/ext-3.0.0/resources/css/ext-all.css, so you need to visit this link, get the code and save it on your local folder)

"Ext3": {
    "type": "Ext3",
    "version": "1.0",
    "properties": {},
    "hideTitlebar": true,
    "resources": {
        "css": ["ext-all.css"],
        "js": [
            {"script": "http://extjs.cachefly.net/ext-3.0.0/adapter/ext/ext-base.js","property":"Ext"},
            {"script": "http://extjs.cachefly.net/ext-3.0.0/ext-all.js","property":"Ext"},
            {"script": "Ext3.js", "property":"Ext3"}
        ]

      }
    },