PDA

View Full Version : ie tpl overwrite unknow runtime error



TopKatz
17 Aug 2009, 4:37 AM
Im getting a unknown runtime error in ie 7 and 8 when pushing data into a template. This little test case will show what Im seeing. It works fine in FF. Just press the test button in the toolbar.


Ext.onReady(function(){

record = {"data":{"test1":"test1","test2":"test2"}};

tpl = new Ext.Template(
'<div class= "persData"><dl>',
'<p><dt class ="label">Date of Birth:</dt><dd> {test1}</dd></p>',
'<p><dt class ="label">Country of Origin:</dt><dd> {test2}</dd></p>',
'</dl></div>'
);



panel = new Ext.Panel({
region:'center',
html:'test',
tbar:[{text:'test',handler:write}]

});
vp = new Ext.Viewport({
layout:'border',
items:panel
});
});

var write = function(){
tpl.overwrite( panel.body, record.data);


}

Condor
17 Aug 2009, 4:53 AM
<p> elements aren't allowed as children of <dl>

(Firefox in XHTML mode would have failed too)

BitPoet
17 Aug 2009, 5:08 AM
Looks to me like IE throws a fit due to what it considers invalid html there when it encounters the dt or dd tags (block level elements) inside a p tag (which may only contain inline elements).

TopKatz
17 Aug 2009, 5:18 AM
thanks guys, Ill rework my template.

Katz