1. #1
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,592
    Vote Rating
    324
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default ComboBox via File System

    ComboBox via File System


    Instantiating a ComboBox throws an error when a page is loaded directly off the file system. Note it works fine over a web server.

    Any ComboBox will do:

    Code:
    var combo1 = Ext.create('Ext.form.field.ComboBox', {
        renderTo: Ext.getBody(),
        store: ['Red', 'Green', 'Blue']
    });
    The same error on both Chrome and FF:

    Ext.util.CSS.getRule("." + Ext.baseCSSPrefix + "form-trigger") is undefined

    Ext.form.field.Trigger.prototype.triggerWidth = parseInt(Ext.util.CSS.getRule('.' + Ext.baseCSSPrefix + 'form-trigger').style.width, 10);

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,502
    Vote Rating
    47
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    I suspect that the CSS is not being loaded at all.

  3. #3
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,592
    Vote Rating
    324
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    I made a more sophisticated test case to help confirm that I wasn't making a silly mistake. Here I create a panel and a button and they render successfully, confirming that the CSS has loaded. Then when I click the button to add a combobox it throws the error. Switching to 4.0.7 it works fine. Going through a web server also works fine.

    Code:
    Ext.create('Ext.panel.Panel', {
        height: 300,
        renderTo: Ext.getBody(),
        title: 'Panel',
        width: 300,
        tbar: [{
            text: 'Add',
            handler: function(btn) {
                btn.up('panel').add({
                    renderTo: Ext.getBody(),
                    store: ['Red', 'Green', 'Blue'],
                    xtype: 'combobox'
                });
            }
        }]
    });

  4. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,592
    Vote Rating
    324
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    It's not just comboboxes. I'm hitting the same problem with Ext.form.Labelable. Blows up here:

    Code:
    Ext.form.Labelable.errorIconWidth = parseInt(Ext.util.CSS.getRule('.' + Ext.baseCSSPrefix + 'form-invalid-icon').style.width, 10);
    Seems there's an issue with getRule when running directly off the file system.

  5. #5
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,502
    Vote Rating
    47
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    This is not good!

    http://code.google.com/p/chromium/is...etail?id=45786

    We need to be able to know how some things are styled, and sometimes need to ask the stylesheet.

    I added my vote to fix that. I urge people to log in and add their votes.

  6. #6
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,592
    Vote Rating
    324
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    Ouch.

    It's not just Chrome though, FF9 is the same. Works fine in Opera...

    It'd be a shame if ExtJS lost support for running off the file system, I've always found that really useful for prototyping and testing.

  7. #7
    Sencha User unkn's Avatar
    Join Date
    Mar 2011
    Posts
    5
    Vote Rating
    2
    unkn is on a distinguished road

      0  

    Default


    Hello there
    Got exactly the same problem.
    Code:
    Ext.util.CSS.getRule("." + Ext.baseCSSPrefix + "form-trigger") is undefined
    Ext.form.field.Trigger.pro...x + 'form-trigger').style.width, 10);
    As skirtle said, most of the 4.1 beta examples using combo don't work for me (Chrome 16, FF 8) !

  8. #8
    Sencha Premium Member
    Join Date
    Feb 2010
    Posts
    53
    Vote Rating
    0
    medifirst is on a distinguished road

      0  

    Default


    Hi, the same problem throw a web server with this example:

    Code:
    <html>
        <head>
            <title>Aper├žu avant impression</title>
                                                                                                  
    
            
            <link rel="stylesheet" type="text/css"    href="/lib/js/extjs41/resources/css/ext-sandbox.css">
            <script type="text/javascript" src="/lib/js/extjs41/builds/ext-all-sandbox.js"></script>
            
            <script type="text/javascript">
    
                           
                    Ext4.onReady(function()
                    {
                        Ext4.create('Ext4.container.Viewport',   
                        {
                        /*Ext4.create('Ext4.panel.Panel',
                        {*/
                            renderTo: Ext4.getBody(),
                            
                            items:
                            [{
                                 xtype: 'combobox'
                                  ,fieldLabel: 'test combo'
                                  ,queryMode: 'local'
                                  ,displayField: 'label'
                                  ,valueField: 'id'
                                  ,store: Ext4.create('Ext4.data.Store',
                                  {
                                       fields: ['id', 'label']
                                      ,data:
                                      [
                                           {'id': 0, 'label': 'value 1'}
                                          ,{'id': 1, 'label': 'value 2'}
                                      ]
                                  })
                            }
                            ,
                            {
                                    xtype: 'slider'
                                   ,width: 250
                                   ,increment: 1
                                   ,minValue: -100
                                   ,maxValue: 100
                               }]
                        });
                    });
    
            </script>
        </head>
        <body></body>
    </html>
    Browser : Firefox 9.0.1

  9. #9
    Sencha User BulletzBill's Avatar
    Join Date
    Mar 2010
    Location
    New York
    Posts
    138
    Vote Rating
    0
    BulletzBill is on a distinguished road

      0  

    Default


    Quote Originally Posted by skirtle View Post
    Ouch.

    It's not just Chrome though, FF9 is the same. Works fine in Opera...

    It'd be a shame if ExtJS lost support for running off the file system, I've always found that really useful for prototyping and testing.
    I've also confirmed these issues for Chrome 16 and Firefox 9.0.1 in OS X, both running locally via file:// and from a web server.

  10. #10
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,010
    Vote Rating
    183
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    I entered a bug just now with a similar issue.
    http://www.sencha.com/forum/showthre...et%28%29-error