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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:06:55+00:00 2026-06-15T12:06:55+00:00

I am trying to dynamically add list(with its items) to my container. Instead of

  • 0

I am trying to dynamically add list(with its items) to my container.
Instead of simple HTML template, I need list items to contain panel with a title bar, image & few more things.

To do this I am loading store data and within its callback creating List & array of items. Then I add items to the list and list to the container but end result is just last panel visible instead of sliding list of all panels.

Here is my code:

    var vLists = [];
    this.load({
        callback: function(records, operation, success) {
            var hccontainer = Ext.getCmp('hccontainer');
            this.each(function(record){
                var sid = 'styleStore'+record.get('id');
                var styleTemplate = eval('tpls.styleTemplate_' + record.get('id'));
                vLists.push({
                    xtype: 'panel',
                    scrollable: 'false',
                    layout: 'fit',
                    cid : record.get('id'),
                    ctype : record.get('type'),
                    cname : record.get('name'),
                    stid : sid,
                    tp : styleTemplate,
                    items: [
                        {
                            xtype : 'titlebar',
                            title : record.get('name'),
                            docked : 'top',
                            cls : 'x-toolbar-transparent-top'
                        },
                        {
                            xtype : 'image',
                            src : record.get('image'),
                        }
                    ]
                });
            });
            //hccontainer.remove(Ext.getCmp('hc'), true);
            Ext.getCmp('hc').destroy();
            var hc1 = Ext.create('Ext.dataview.List', {
                layout : 'fit',
                config: {
                    direction: 'horizontal',
                    id : 'hc'
                }
            });
            hc1.setItems(vLists);
            Ext.getCmp('hccontainer').add(hc1);
        },
        scope: this
    });

Is this right way to add items or I am missing something.

PS Instead of List if I use Carousel, this works fine

  • 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-15T12:06:56+00:00Added an answer on June 15, 2026 at 12:06 pm

    Carousel is more of a layout component than List is. It doesn’t look like you need to use a list, I don’t see any handler for item taps for example. If you want to avoid using templates than you should not use a List. Instead just make a component with a list-like layout. I would use a container with a vbox layout, scretched horizontally and with a static height. You can then put whatever item configuration you want into this.

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

Sidebar

Related Questions

I am trying to dynamically add items to a list adapter using an alert
I am trying to add a html snippet dynamically which contains named anchors and
Him I'm trying to add a jQuery tooltip to a dynamically generated list, the
I have a WPF application that I'm trying to dynamically add items to a
I am trying to dynamically add some content to a list of checkboxes in
I'm trying to dynamically create and remove items from a list, it works just
I am trying dynamically add children DIV under a DIV with ID=prnt. Addition of
I am trying to dynamically add input fields, which I am able to do.
Im trying to add a div tag dynamically with some data attributes but the
I am trying add picture boxes dynamically. My code is as PictureBox picture =

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.