Wednesday, 21 August 2013

Ext JS: How to add a break(new line) after x iterations using xtemplate

Ext JS: How to add a break(new line) after x iterations using xtemplate

I want to add a </br> after 10 iterations in xTemplate. I tried many ways
but it did not work. Please help.
Sample code is as below.
days = new Ext.XTemplate(
'<b>Days of month</b>',
'<table width="100%"><tr><td style="word-wrap:break-word;">',
'<tpl for=".">',
'<tpl for="data">',
****'{% if (xindex % 10 === 0)' +
'</br>' +
'{% } %}',*/****
,'{fieldValue}',
'</tpl>',
'</tpl>',
'</td></tr></table>',
I tried to use xIndex but it did not work and did not take any effect.
Please let me know where I am doing it wrong.

No comments:

Post a Comment