Results 1 to 3 of 3

Thread: Clear tpl?

  1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    7
    Vote Rating
    0
      0  

    Default Answered: Clear tpl?

    Hi all,

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

    http://dev.sencha.com/deploy/ext-4.0...ct/direct.html

    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:

    {
    x:5,
    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.

  2. So you need to overwrite the tpl instead of append to it. Something like this
    Code:
    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.

  3. #2
    Sencha Premium User Tim Toady's Avatar
    Join Date
    Feb 2010
    Location
    Pennsylvania
    Posts
    605
    Answers
    67
    Vote Rating
    287
      0  

    Default

    So you need to overwrite the tpl instead of append to it. Something like this
    Code:
    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.

  4. #3
    Sencha User
    Join Date
    Sep 2012
    Posts
    7
    Vote Rating
    0
      0  

    Default

    Thanks

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •