ExtJs XTemplate在包含函数时不能与IE一起使用 [英] ExtJs XTemplate is not working with IE when it contains functions

查看:354
本文介绍了ExtJs XTemplate在包含函数时不能与IE一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ExtJs(4.2)我正在面对一个问题,我的XTemplate在包含函数时不能使用IE。

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.

推荐答案

我没有得到关于这个主题的更多帮助,然后我深入分析,发现应用功能对于IE而言不能正常工作。 p>

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

应用方法做什么,它编译模板并绑定数据
我进一步调查它发现应用本身并不是一个问题。它是我的模板中的功能,IE无法处理传递给函数的值。

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})]}"

好的是,Chrome也一样:)

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

这篇关于ExtJs XTemplate在包含函数时不能与IE一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆