所有,我正在努力解决一个错误TypeError: curTemplete.addSection is not a function
,请原谅我不熟悉 js OO,请帮助查看我的问题。谢谢。
代码如下所示。
Templete.js
LayoutTemplete=function(currentTmpContainer,templeteId,data)
{
var curTemplete = this;
curTemplete.addSection(null, null);//this line run with error above.
this.addSection = function(uiItem, data) {
alert('ddd');
};
};
在dom 就绪事件中。
function loadTempleteContent(templeteId)
{
var jData=[{name: 'jerry'},{name: 'mike'},{name: 'claire'}];
var tmp = new LayoutTemplete($("#currentTmpContainer"),templeteId,jData);
}