Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8575839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:47:09+00:00 2026-06-11T19:47:09+00:00

Can anybody put some light on this problem I would like to add a

  • 0

Can anybody put some light on this problem

I would like to add a button to itemTpl in Sencha Touch. The key in {} will be replaced with the values in store. However, is it possible to add buttons in the template as well ?

For example, you list favorite list of music with delete button in each item.

Possible ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:47:11+00:00Added an answer on June 11, 2026 at 7:47 pm

    I am not sure whether we can add buttons to itemTpl in Sencha-2 but we can surely add an image to itemTpl and then we can perform various operations (like in your case you want to delete).
    Here is the code :-

     //demo.js
    
     Ext.define("Stackoverflow.view.demo", {
     extend: "Ext.Container",
     requires:"Ext.dataview.List",
     alias: "widget.demo",
    
     config: {
     layout: {
        type: 'fit'
     },
     items: [
    {
        xtype: "list",
        store: "store",
        itemId:"samplelist",
        loadingText: "Loading Notes...",
        emptyText: "<div class=\"notes-list-empty-text\">No notes found.</div>",
        onItemDisclosure: true,
        itemTpl:"<div class='x-button related-btn' btnType='related' style='border: none; background: url(\"a.png\") no-repeat;'></div>"+
                   "<div class=\"list-item-title\">{title}</div>"
        grouped: true
    }
    
    ],
    listeners:
    [
            {
            delegate: "#samplelist",
            event: "disclose",
            fn: "onDiscloseTap"
        }
     ]
     },    
      onDiscloseTap: function (list, record, target, index, evt, options) {
    
       this.fireEvent('ondisclosuretap', this, record);
      }
    });
    

    // Democontrol.js

                     Ext.define("Stackoverflow.controller.Democontrol", {
              extend: "Ext.app.Controller",
                config: {
                refs: {
                    // We're going to lookup our views by xtype.
                    Demo: "demo", 
                    Demo1: "demo list",
                      },
                control: {
                    Demo: { 
                           ondisclosuretap: "Disclosure", 
                     },
                    Demo1: { 
    
                         itemtap:"imagetap" 
    
                    }
    
                }
            },
    
             Disclosure: function (list, record,target,index,e,obj) {
               Ext.Msg.alert('','Disclosure Tap');
    
            },
    
              imagetap: function (dataview,index,list,record, tar, obj) { 
                 tappedItem = tar.getTarget('div.x-button');
                btntype = tappedItem.getAttribute('btnType');
                if(btntype == 'related')
                {
                Ext.Msg.alert('','Image/Icon Tap');
                }
            },
    
            // Base Class functions.
            launch: function () {
                this.callParent(arguments);
    
             },
            init: function () {
                this.callParent(arguments);
    
            }
            });
    

    //app.css

                    .related-btn
               {
                  width: 100px;
                  height: 100px;
                  position: absolute;
              bottom: 0.85em;
                  right: 2.50em;
                -webkit-box-shadow: none;
               }
    

    Hope this will help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anybody please put some light on the need of the method getTypeInstance(), which
can anybody shed some light on this ? I can't seem to be able
Can anybody put lime light on what possible problems might emerge if an application
Does anybody can provide an answer to such issue? I`m trying to put some
Can anybody please tell me how to put array values into a string or
Can anybody please tell me why the removeEventListener call is not working? this.addEventListener(Event.ENTER_FRAME, eventCall,
Can anybody show with some examples the exact difference between .. and ... operator?
I'm using rails 2.3.10 and ruby 1.9.2 My problem can be put into these
hi every body can some one help me with thi problem i have a
Can anybody give any working example of how to read/write Unicode text files using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.