Get Ext JS version

与世无争的帅哥 提交于 2019-12-22 04:13:16

问题


I have taken over a PHP + Ext JS project. Unfortunately, there is no documentation. How do I find out the Ext JS version that is being used?

In jQuery, we get the version by running $().jquery;. Anything like this in Ext JS?


回答1:


Two easy ways to do this. First is from a web browser's console..

In ExtJS 3.x:

Ext.version;

In ExtJS 4.0:

Ext.getVersion('extjs');

In >= ExtJS 4.1

Ext.getVersion().version;

Or you can look in the ext-all-debug.js and check the version number at the top of the script. In all versions dating back to 1.0 they include the version number at the top of the ext-all-debug script, it might be called something else but just have a look around your application hierarchy.




回答2:


Since ExtJS 4.1.1:

Ext.getVersion().version;



回答3:


http://docs.sencha.com/ext-js/4-0/#/api/Ext.Version-method-getVersion

var ver = Ext.getVersion('core');
            if (ver.isLessThan('4.0.1')) {
                Ext.Msg.show({
                   title: 'Err',
                   msg: 'Old version',
                   buttons: Ext.Msg.OK,
                   icon: Ext.Msg.ERROR
               });



回答4:


put this in javascript function.

            var majorVersion;
        var fullVersion;
        if (Ext.version != undefined) {
            majorVersion = Ext.version.substring(0, Ext.version.indexOf("."));
            fullVersion = Ext.version;
        } else {
            majorVersion = Ext.getVersion().getMajor();
            fullVersion = Ext.getVersion().version;
        }
        alert("Ext version:"+majorVersion+" "+fullVersion);


来源:https://stackoverflow.com/questions/6607205/get-ext-js-version

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!