PDA

View Full Version : Object has no method markup, DomHelper



rahul.sood
4 Feb 2014, 4:04 PM
I am trying to use the following code as explained in the example for DomHelper (http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.DomHelper)


var html = '<tr id="{0}" class="{1}" height="{2}" ><td colSpan="{3}" class="{4}">{5}</td></tr>';
var tpl = new Ext.DomHelper.createTemplate(html);

whenever i call Ext.DomHelper.createTemplate, i get the error
Uncaught TypeError: Object [object Object] has no method 'markup'
even though i am following the example.

Any idea what could be going on ?

skirtle
5 Feb 2014, 4:45 AM
The example is wrong. The keyword new shouldn't be there.

palakurthivishal
5 Feb 2014, 5:48 AM
Hello rahul.sood,
As said by Mr.Skirtle, there shouldn't be "new" keyword since the class is singleton. It restricts you from creating instances of that class.