PDA

View Full Version : [FIXED] [PR1] Newlines break XTemplate.from



jurrie
19 Oct 2011, 10:13 PM
A feature I loved in Sencha 1.1 was creating templates from HTML nodes:


tpl: Ext.XTemplate.from('myTemplate', { method: function() });

This does work when I, for example, have the following HTML node:


<textarea id="myTemplate" class="x-hidden-display"><p>Name: {name}</p></textarea>

However, when using newlines in the template, things go wrong:


<textarea id="myTemplate" class="x-hidden-display">
<p>Name: {name}</p>
</textarea>

This results in an uncaught SyntaxError:



Uncaught SyntaxError: Unexpected token ILLEGAL
Ext.define.compilesencha-touch-all-debug-w-comments.js:22237
Ext.define.applyOutsencha-touch-all-debug-w-comments.js:22804
Ext.define.applysencha-touch-all-debug-w-comments.js:22792
Ext.define.overwritesencha-touch-all-debug-w-comments.js:22205
Ext.define.updateDatasencha-touch-all-debug-w-comments.js:51379
ExtClass.registerPreprocessor.Ext.Object.each.data.(anonymous function)sencha-touch-all-debug-w-comments.js:5381

Jamie Avins
31 Oct 2011, 10:34 AM
Thank you for the report.

Jamie Avins
19 Jan 2012, 11:35 AM
This has been fixed for the next release.