1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    79
    Answers
    7
    Vote Rating
    1
    jonathansimmons is on a distinguished road

      0  

    Default Unanswered: Way to add a button to a Ext.Template

    Unanswered: Way to add a button to a Ext.Template


    So I have a template being populated with data from an ajax request. My goal is to let an item in that template be tappable.

    my thought was to simply give the button a unique id or class (preferably class as there may be many) then use the refs and controls in the controller to specify a handle for the tap action.

    I can't seem to get this working through. Is this not how it works?

    example:
    Code:
    Ext.define('STMobile.controller.Cases', {
        extend: 'Ext.app.Controller',
        requires: ['Ext.data.Store'],
            
        config: {
    
            refs: {
            casesList: 'casesindex',
            testRef: '#doctorbutton'
            },
        
        control: {
            casesList: {
                itemtap: 'onCaseTap',
                activate: 'onCaseIndexActivate'
            },
            testRef: {
                tap: 'showTest'
            }
        },
    
    
        },
        showTest: function(){
            console.log('test tapped');
        },
         onCaseTap: function() {
           // omitted for clarity but this function loads uses the getCaseTPL function and pushes the new view
        },
    getCaseTpl: function() {
            return new Ext.XTemplate([
                '<tpl for=".">',
                    '<div class="case">',
                        '<div class="">{date:date("M d, Y")}</div>',
                        '<div class="">{name}</div>',
                    '</div>',
            '<tpl for="testinfo">',
                '<div id="test">',
                            '<div class=""><a href="#" id="testbutton">{name}</a></div>',
                            '<div class="">{email}</div>',
                        '</div>',
            '</tpl>',
                '</tpl>'
            ].join(''));
        },

  2. #2
    Sencha User
    Join Date
    Nov 2011
    Posts
    79
    Answers
    7
    Vote Rating
    1
    jonathansimmons is on a distinguished road

      0  

    Default


    In an effort to answer my question I've stumbled on dataview component which i think may be what I want. however the example seems to be a complex way just to add a button and while this will help and was my original question. I'm actually thinking I'd like to let the user click on a section of data.

    SO in my example above I'm currently only displaying the name of the test but there is more info I'd like to display.Then the user could tap on any of the info for the test and it will push in a page with the full test details.

    Is this doable with some data view Component finagling or does this only support the addition of dynamic buttons to the dataview?

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar