1. #1
    Sencha Premium Member tellioglu's Avatar
    Join Date
    Apr 2007
    Location
    Vienna, Austria
    Posts
    48
    Vote Rating
    0
    tellioglu is on a distinguished road

      0  

    Default Templates / Select-Elements / IE6

    Templates / Select-Elements / IE6


    Hi!

    While trying to learn how to use templates I found a strange behaviour of MS IE 6. Just for testing purposes I tried to create a select element from HTML and append some option elements created from a template.

    In the following code IE 6 does not create the option elements correctly. It does however create the nested li-elements as it should.


    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
        <head>
            <title>Ext JS Test 1</title>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                                      
            <style type="text/css" media="all">
                @import './ext-1.1.1/resources/css/ext-all.css';
            </style>             
    
            <script type="text/javascript" src="./ext-1.1.1/adapter/ext/ext-base.js"></script>
            <script type="text/javascript" src="./ext-1.1.1/ext-all-debug.js"></script>
            <script type="text/javascript">
    
    Ext.BLANK_IMAGE_URL = './ext-1.1.1/resources/images/default/s.gif';
     
    Ext.namespace('Ext.Test');
       
    Ext.Test = function() {
    
        return {
    
            init :  function() {
                var button = Ext.get('button');
                button.on('click', Ext.Test.onButtonClick);
            },
            
            onButtonClick : function(event) {
    
                var selectElement = Ext.DomHelper.insertAfter(
                    'test-para', 
                    '<select id="select-operators" name="select-operators"></select>'
                    );
                var template = new Ext.Template(
                    '<option value="{value}">{name:trim}</option>'
                    );
                template.append('select-operators', {name: 'foo', value: 'bar'});
                
                
                
                var selectElement = Ext.DomHelper.insertAfter(
                    'test-para', 
                    '<ul id="ul-operators" name="ul-operators"></select>'
                    );
                var template = new Ext.Template(
                    '<li>{value} : {name:trim}</li>'
                    );
                template.append('ul-operators', {name: 'foo', value: 'bar'});
            }
    
        };
    }();
    
    Ext.EventManager.addListener(window, 'load', Ext.Test.init);
            </script>
        </head>
        <body>
        
            <h1>Ext JS Test 1</h1>
    
            <form id="edit-form" method="post" >
                <input id="button" type="button" value="Test"/>
                <div id="test-para">test-paragraph</div>
            </form>
    
        </body>
    </html>

    I know that I could use a MasterTemplate, but maybe somebody could explain to me why the code is not working?

    Thanks in advance,
    Horst

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,833
    Vote Rating
    609
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    I think this is a bug in IE, you have to create select elements by using the dom creation stuff.

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    4
    tryanDLS is on a distinguished road

      0  

    Default


    Quote Originally Posted by evant View Post
    I think this is a bug in IE, you have to create select elements by using the dom creation stuff.
    Evant is correct - this is an IE 'feature'. You can't build options like that. See this thread http://extjs.com/forum/showthread.php?t=1902

  4. #4
    Sencha Premium Member tellioglu's Avatar
    Join Date
    Apr 2007
    Location
    Vienna, Austria
    Posts
    48
    Vote Rating
    0
    tellioglu is on a distinguished road

      0  

    Smile


    Thank you both very much for your quick and helpful replies!

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi