ExtJs XTemplate is not working with IE when it contains functions

流过昼夜 提交于 2019-12-12 06:57:30

问题


I am using ExtJs (4.2) I am facing an Issue that my XTemplate is not working with IE when it contains functions.

Anyone can help.


回答1:


I was not getting more help on this topic then I dig into it and found that apply function is not working perfectly for IE.

xTemplate = new Ext.XTemplate(me.getTemplate(), {
            getCompanyDescriptionHTML: me.getCompanyDescriptionHTML
        });
xTemplate.apply(data));

What apply method do, it compiles the template and bind data in. I further investigated it and found that apply itself is not a problematic. It is function within my template and IE is unable to handle the values passed to the function.

getTemplate: function () {
        var tpl = "<tpl>";
        tpl += "<div>";
        tpl += "{[this.getCompanyDescriptionHTML({values})]}";
        tpl += "</div>";
}

I tried many tricks and finally replacing function parameter values with values:values solved my problem.

"{[this.getCompanyDescriptionHTML({values:values})]}"

The good thing is, the same worked for Chrome as well :)



来源:https://stackoverflow.com/questions/42301039/extjs-xtemplate-is-not-working-with-ie-when-it-contains-functions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!