Results 1 to 2 of 2

Thread: Ext.os.version.version return ''

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    fabio.policeno's Avatar
    Join Date
    Sep 2010
    Location
    Curitiba - Brazil
    Posts
    367

    Default Ext.os.version.version return ''

    Ext.os.version return object version, but is with value 0 for all values, and for version string is as ''.

    Tested in Windows, Linux and Mac in Chrome with Ext JS 6.5

    Workaround for Ext.os.version.version string:
    Code:
    Ext.define('Overrides.env.OS', {
        override: 'Ext.env.OS'
    });
    
    
    Ext.os.getVersionName = function() {
        if(!Ext.isEmpty(Ext.os.version.version)) {
            return Ext.os.version.version;
        }
    
    
        var osName = Ext.os.name,
            userAgent = Ext.browser.userAgent,
            splitVersionMacLinux = function(baseName, replaceUnderscore) {
                splitUserAgent = userAgent.split(baseName);
    
    
                if(splitUserAgent.length > 1) {
                    endOfVersion = splitUserAgent[1].indexOf(';'),
                    firstParantheses = splitUserAgent[1].indexOf(')');
    
    
                    if(firstParantheses > -1 && (firstParantheses < endOfVersion || endOfVersion == -1)) {
                        endOfVersion = firstParantheses;
                    }
    
    
                    unformattedVersion = splitUserAgent[1].substring(0, endOfVersion);
                    return (replaceUnderscore ? unformattedVersion.split('_').join('.') : unformattedVersion);
                }
            },
            osVersion = '',
            splitUserAgent,
            endOfVersion,
            firstParantheses,
            unformattedVersion,
            versionSubStr,
            firstDotComma;
    
    
        switch(osName) {
            case 'MacOS':
                osVersion = splitVersionMacLinux('Mac OS X ', true);     
            break;
            case 'Windows':
                splitUserAgent = userAgent.split('Windows NT ');
    
    
                if(splitUserAgent.length > 1) {
                    versionSubStr = splitUserAgent[1];
                    firstDotComma = splitUserAgent[1].indexOf(';');
                    unformattedVersion = splitUserAgent[1].substring(0, firstDotComma);
    
    
                    switch(unformattedVersion) {
                        case '5.0':
                            osVersion = '2000';
                        break;
                        case '5.1':
                            osVersion = 'XP';
                        break;
                        case '5.2':
                            osVersion = 'Server';
                        break;
                        case '6.0':
                            osVersion = 'Vista';
                        break;
                        case '6.1':
                            osVersion = '7';
                        break;
                        case '6.2':
                            osVersion = '8';
                        break;
                        case '6.3':
                            osVersion = '8.1';
                        break;
                        case '10.0':
                            osVersion = '10';
                        break;
                    }
                }
            break;
            case 'Linux':
                osVersion = splitVersionMacLinux('Linux ', false);
            break;
        }
    
    
        return osVersion;
    }
    
    
    Ext.os.version.version = Ext.os.getVersionName();

  2. #2
    Sencha Premium User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Goiânia - GO, Brazil
    Posts
    902

    Default

    having this same issue!
    Wemerson Januario @JanuarioCoder
    Novanti Tecnologia, Sencha MVP/ Ext JS Consultant
    ____________________________________________
    Hire me on UpWork:

    GitHub
    https://github.com/wemersonjanuario

    Treinamento e Consultoria Ext JS. QUALIFIQUE-SE JÁ!

Similar Threads

  1. Replies: 1
    Last Post: 15 Mar 2017, 2:24 PM
  2. Replies: 9
    Last Post: 17 Nov 2015, 12:32 AM
  3. Replies: 2
    Last Post: 15 Aug 2013, 1:57 PM
  4. Replies: 2
    Last Post: 4 Mar 2013, 11:21 AM
  5. Sencha Build: Production version causes error, Testing version works fine
    By parky128 in forum Sencha Touch 2.x: Discussion
    Replies: 10
    Last Post: 18 Feb 2013, 3:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •