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 7839955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:36:36+00:00 2026-06-02T15:36:36+00:00

I’m trying out the new dataview component and I’m working with this Sencha example:

  • 0

I’m trying out the new dataview component and I’m working with this Sencha example:

http://www.sencha.com/blog/dive-into-dataview-with-sencha-touch-2-beta-2/

In KittensListItem, I removed the image and now I want to add three
buttons that say: “Email”, “Facebook”, and “Twitter”, and not the
value in the Store. When the user clicks on each button, I’d like to
show each button’s respective Store value. How can this be accomplished?

Here’s what the screen looks like at the moment:

enter image description here

Example.view.KittensListItem:

Ext.define('Example.view.KittensListItem', {
    extend: 'Ext.dataview.component.DataItem',
    xtype : 'contactslistitem',

    requires: [ 'Ext.Button', 'Ext.slider.Slider' ],

    config: {

        dataMap: {

            getName: { setHtml: 'name' },
            getSlider: { setValue: 'cuteness' },
            getEmail: { setHtml: 'email' },
            getTwitter: { setHtml: 'twitter' },
            getFacebook: { setHtml: 'facebook' }
        },

        name: { flex: 1 },

        slider: { flex: 1 },

        email: {
            text: 'Email',
            style: 'font-size: 12px;',
            flex: 1
        },
         facebook: {
            text: 'Facebook1',
            style: 'font-size: 12px;',
            flex: 1
        },
        twitter: {
            text: 'Twitter',
            style: 'font-size: 12px;',
            flex: 1
        },

        layout: {
            type: 'hbox',
            align: 'center'
        }
    },

    applyName: function(config) { return Ext.factory(config, Ext.Component, this.getName()); },

    updateName: function(newName, oldName) {
        if (newName) { this.add(newName); }

        if (oldName) { this.remove(oldName); }
    },


    applySlider: function(config) { return Ext.factory(config, Ext.slider.Slider, this.getSlider()); },

    updateSlider: function(newSlider, oldSlider) {
        if (newSlider) { this.add(newSlider); }

        if (oldSlider) { this.remove(oldSlider); }
    },

    applyEmail: function(config) { return Ext.factory(config, Ext.Button, this.getEmail()); },

    updateEmail: function(newEmailButton, oldEmailButton) {
        if (newEmailButton) { this.add(newEmailButton); }

        if (oldEmailButton) { this.remove(oldEmailButton); }
    },

    applyTwitter: function(config) {return Ext.factory(config, Ext.Button, this.getTwitter()); },

    updateTwitter: function(newTwitterButton, oldTwitterButton) {
        if (newTwitterButton) { this.add(newTwitterButton); }

        if (oldTwitterButton) { this.remove(oldTwitterButton); }
    },

    applyFacebook: function(config) { return Ext.factory(config, Ext.Button, this.getFacebook()); },

    updateFacebook: function(newFacebookButton, oldFacebookButton) {
        if (newFacebookButton) { this.add(newFacebookButton); }

        if (oldFacebookButton) { this.remove(oldFacebookButton); }
    }
});

Model:

Ext.define('Example.model.Kitten', {
    extend: 'Ext.data.Model',

    config: {
        fields: [
            "name",
            "email",
            "twitter",
            "facebook",
            { name: "cuteness", type: 'int' }
        ]
    }
});

Store:

Ext.define('Example.store.Kittens', {
    extend: 'Ext.data.Store',
    requires: ['Example.model.Kitten'],

    config: {
        model: 'Example.model.Kitten',

        data: [
            { name: 'one',  email: 'email@addr', twitter: '@twitter', facebook: 'Facebook...', cuteness: 70 },
            { name: 'two',  email: 'email@addr', twitter: '@twitter', facebook: 'Facebook...', cuteness: 90 },
            { name: 'three',  email: 'email@addr',twitter: '@twitter', facebook: 'Facebook...',cuteness: 40 }
        ]
    }
});
  • 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-02T15:36:41+00:00Added an answer on June 2, 2026 at 3:36 pm

    After scouring the Internet I found a solution to the ‘tap’ event for each button. The trick is to add a tap listener in the update* functions. I’m still not sure how to set the static labels on each button.

    Btw, a better answer gets someone else the upvote and check.

        updateEmail: function(newEmailButton, oldEmailButton) {
            if (newEmailButton) {
            newEmailButton.on('tap', this.onEmailButtonTap, this);
                this.add(newEmailButton);
            }
    
            if (oldEmailButton) {
                this.remove(oldEmailButton);
            }
        },
    
        onEmailButtonTap: function(button, event) {
    
        var record = this.getRecord();
            Ext.Msg.alert(record.get('email') +  ", " + record.get('facebook') );
      }
    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:

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.