Results 1 to 3 of 3

Thread: Can't seem to get tpl working

  1. #1
    Sencha User
    Join Date
    Jun 2015
    Posts
    7

    Default Answered: Can't seem to get tpl working

    Hi,

    The tpl isn't getting rendered to the panel, but why? I've tried playing with tplWriteMode and renderTpl but with no success. What am I missing?

    Side question: As well, what's the best container to use to simply display a text message with values from a store?

    Code:
    createWindow: function(passedStore, title) {        
            var me = this;
            var desktop = me.app.getDesktop();
            var win = desktop.createWindow({
                title: title,
                iconCls: 'properties-icon-small',
                height: me.height,
                width: me.width,
                layout: 'fit',
                items: [
                    {
                        xtype: 'panel',
                        store: passedStore,
                        title: 'Title',
                        id: 'network-info-panel',
                        
                        height: 100, // for testing
                        width: 100, // for testing
                        
                        // None of these work
                        tpl: new Ext.XTemplate('<p>Test</p>');
                        // tpl: 'Single String',
                        // tpl: [
                        //     'String A',
                        //     'String B'
                        // ]
                    }
                ]
            }); // var win
            win.show();
        } // createWindow()

  2. You have no data, so there's nothing to render the tpl with.

  3. #2
    Sencha Premium User
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258
    Answers
    759

    Default

    You have no data, so there's nothing to render the tpl with.

  4. #3
    Sencha User
    Join Date
    Jun 2015
    Posts
    7

    Default

    Silly mistake, I was testing without data to see if I could get it working and assumed it would render regardless of having data or not.

    Working now,
    Thanks.

Similar Threads

  1. Replies: 8
    Last Post: 25 Feb 2014, 2:16 PM
  2. Code not working on IPad Simulator whereas working fine on Safari/Crome
    By pankymishr in forum Sencha Touch 1.x: Charts
    Replies: 16
    Last Post: 29 Nov 2012, 10:57 PM
  3. Replies: 1
    Last Post: 18 Sep 2012, 8:56 AM
  4. Replies: 5
    Last Post: 27 Oct 2011, 5:12 AM
  5. Replies: 4
    Last Post: 30 Sep 2009, 6:32 PM

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
  •