View Full Version : How to add footer element to View?

8 Nov 2012, 5:37 PM

I am a beginner in extjs. I am trying to add footer to View in the template. here is my template

me.tpl = [
'<tpl for=".">',
'<div class="fieldmapping-item"/>',

and the "test" is repeating for each item. How to make it appear only once and that too at the end?


8 Nov 2012, 5:55 PM
just to check, is createHeader only being called once? or you have it running some kind of condition so it returns empty every time after first?

8 Nov 2012, 6:01 PM
it is called just once. However if i put me.createHeader() at the end, i.e. after </tpl> it is called for each item.

8 Nov 2012, 6:03 PM
The </tpl> should be ending the loop (and causing the <p> to only run once, that's how it works on mine) so I'm making an educated guess here... Isn't <div> an open/close tag(<div>...</div>), not a singleton (<div />) which might mean it's looking for a tag to close it? (possibly therefore assuming the </tpl> is meant to go inside the tag?) just a guess, but maybe worth a try.

8 Nov 2012, 6:08 PM
thats it... thats the problem. Thanks much.