View Full Version : Clear tpl?

5 Oct 2012, 5:38 AM
Hi all,

I have implemented an application with some functionality very similar too this example:


Basically I copied it and modified for my purposes. I need to add in the ability to 'clear' the output. Is this possible? The output panel is an item on another panel and is defined as follows:

y: 155,
id: 'output',
xtype: 'panel',
tpl: '<p>{data}</p>',
tplWriteMode: 'append',
margin: 0,
hideLabel: true,
readOnly: true,
autoScroll: true,
anchor: '-5 -5' // anchor width and height

Thanks in advance.

Tim Toady
5 Oct 2012, 6:10 AM
So you need to overwrite the tpl instead of append to it. Something like this

yourPanel.tpl.overwrite( yourPanel.getTargetEl() );

Or if you don't want to use private methods/properties you could set the tplWriteMode to 'overwrite' and call update, but then you would need to set it back to append.

5 Oct 2012, 6:25 AM
Thanks :)