ExtJs XTemplate is not working with IE when it contains functions

419 Views Asked by At

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

There are 1 best solutions below

1
On

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