Results 1 to 3 of 3

Thread: mistake in Ext.Template?

  1. #1
    Ext User
    Join Date
    Jul 2008
    Posts
    10
    Vote Rating
    0
      0  

    Red face mistake in Ext.Template?

    1. the method append does not work in ie when i append a "option" tag to a "select" tag
    append( Mixed el, Object/Array values, [Boolean returnElement] )
    var tpl=new Ext.Template('<option value="{value}"> {text}</option>');
    tpl.append("the select tag id",{value:'a',text:'b'});
    2.sometime the template created by method Template.from does not work
    eg:
    html:
    <div id="target_el">
    </div>
    <div style="display:none">
    <div id='tpl'> <a href="{href}" title="{title}"> {text}</a></div>
    </div>
    javascript:
    var str='<a href="{href}" title="{title}"> {text}</a>';
    var tpl_=new Template(str);
    var tpl =Ext.Template.from('tpl');
    tpl_.append("target_el",{href:'a.jsp',title:'test',text:'aaaaa'});
    tpl.append("target_el",{href:'a.jsp',title:'test',text:'aaaaa'});

    result:
    <div id="target_el">
    <a href="a.jsp" title="test"> aaaaa</a>
    <a href="{href}" title="test"> aaaaa</a>
    </div>
    forgive me and my poor english.

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Answers
    1
    Vote Rating
    119
      0  

    Default

    1. IE doesn't support adding select options through DOM manipulation (you'll have to create Option instances and add() them to the options property, see here).

    2. from() only works if your template doesn't contain text that gets corrupted by the browser. It's recommended to use a TEXTAREA as the root element, because browsers don't corrupt a TEXTAREA value.

  3. #3
    Ext User
    Join Date
    Jul 2008
    Posts
    10
    Vote Rating
    0
      0  

    Default

    thank you!

Posting Permissions

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