ExtJs XTemplate is not working with IE when it con

2019-09-20 15:43发布

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条回答
成全新的幸福
2楼-- · 2019-09-20 16:07

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 :)

查看更多
登录 后发表回答