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

  • Home
  • SEARCH
  • 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 9239911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:05:55+00:00 2026-06-18T08:05:55+00:00

Im trying to populate a custom component using a store (actually a store with

  • 0

Im trying to populate a custom component using a store (actually a store with local data) in a Sencha Touch 2 project.

My idea is to create one custom component for each element in the store, but actually nothing happens.

I have tried several things but anything works, could you help me? I have done an example to show the problem:

model:

Ext.define('project.model.city', {
  extend: 'Ext.data.Model',
  config: {
    fields: [
      {name: 'country', type: 'string'},
      {name: 'city', type: 'string'}
    ]
  }
});

store:

Ext.define('project.store.cities', {
  extend: 'Ext.data.Store',
  requires: ['project.model.city'],
  model: 'project.model.city',
  autoLoad: true,
  data: [
    { country: 'Germany', city: 'Berlin' },
    { country: 'Italy', city: 'Rome' }
  ]
});

View with store:

Ext.define('project.view.cityAll', {
  extend: 'Ext.Panel',
  xtype: 'cityAllView',
  config: {
    items:[{
      xtype: 'cityItemView',
      store: 'project.store.cities',
    }]
  }
});

Custom component View:

Ext.define('project.view.cityItem', {
  extend: 'Ext.Panel',
  xtype: 'cityItemView',
  config: {
    items: [{
      itemTpl: '{city}'
    }]
  }
});
  • 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-18T08:05:56+00:00Added an answer on June 18, 2026 at 8:05 am

    You need to assign store to cityItemView instead of cityAllView. cityItemView is having template specified and needs to be loaded with data.

    Ext.define('project.view.cityItem', {
      extend: 'Ext.Panel',
      xtype: 'cityItemView',
      config: {
        items: [{
          xtype:'list', 
          itemTpl: '{city}'
          store:'project.store.cities'
        }]
      }
    });
    

    If you want to set data into panel, then you’d need to call setData(). A panel can not load data from store directly. You can use list view instead so show city, country pair. cityView no longer needed store property that way.

    Give this a try.

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

Sidebar

Related Questions

I'm trying to write a custom method to populate a ListView control using Generics:
I'm trying to populate a list of files, and I'm using a custom ArrayAdapter
I am trying to create a custom cell for my UITableView. I am using
I'm trying to create a custom visual studio extension. It involves a toolbar, with
I have succesfully able to populate the my storage extension table using my custom
I'm trying to use a custom form, to populate over fields in another form,
I'm trying to build an interactive map using google's map api v3. The idea
I have a custom adapter. Within my getView() , I'm trying to populate holder.contact
I am trying to create different themes for a custom PropertyGrid control that inherits
I am trying to create a spinner that looks exactly like the one in

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.