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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:19:22+00:00 2026-06-02T10:19:22+00:00

First program logic: I have a main panel and there is a list at

  • 0

First program logic:

I have a main panel and there is a list at the left side and another panel at the right side.

When user touches the list item some html appears in right panel. What i need to do is using carousel instead of right panel.

My view

   Ext.define('MyApp.view.MyPanel', {   
extend: 'Ext.Panel',
xtype:'mypanel',

config: {
    ui: 'dark',
    layout: {
        type: 'card'
    },
    items: [
        {
            xtype: 'titlebar',
            docked: 'top',
            title: 'Lezzet Dunyasi',    
        },
        {
            xtype: 'list',
            docked: 'left',
            id: 'mylist',
            ui: 'round',                
            pinHeaders: false,
            grouped: true,
            //disableSelection: true,
            width: 331,
            itemTpl: [
                '<img src="{img_url}" width="60" heigh="60"></img><span>{label}</span>'
            ],
            store: 'Menius',
            items: [
                {
                    xtype: 'searchfield',
                    docked: 'top',
                    placeHolder: 'Search...',

                },
            ]
                },
                {
                xtype: 'panel',
                styleHtmlContent:true,
                style: {
                backgroundImage: 'url(resources/img/Landscape.png)',
                backgroundRepeat: 'no-repeat',
                backgroundPosition: 'center'
                },
                id:'mypanel'
                }
            ]
        }

        });

As you can see there is a xtype:panel and i tried to modify that code and i did it like this

     xtype: 'carousel',

                defaults{
                styleHtmlContent:true,  
                id:'mypanel'},

                items: [
                {
                html : 'Item 1',
                style: 'background-color: #5E99CC'
                },
                {
                html : 'Item 2',
                style: 'background-color: #759E60'
                },
                {
                html : 'Item 3'
                }
            ]

Also i use a controller

    Ext.define('MyApp.controller.MeniuController',{
extend:'Ext.app.Controller',
config:{
    refs:{
        leftMeniu:'mypanel list[id=mylist]',
        myPanel:'mypanel panel[id=mypanel]'
    },
    control:{
        leftMeniu:{
            itemtap:'onItemTap'
        }
    }
},

onItemTap:function(list, index, item, record, e , opts)
{
    var content = '<h2>' + record.get('label') +'</h2>' + record.get('html');
    this.getMyPanel().setHtml( content );
}

});

And i modified this part like this

    refs:{
        leftMeniu:'mypanel list[id=mylist]',
        myPanel:'mypanel carousel[id=mypanel]'

Although these modifications i can’t run my code , what should i do ?

  • 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-02T10:19:25+00:00Added an answer on June 2, 2026 at 10:19 am

    A couple of small issues that I see. You are missing a colon on defaults: And I think you want to move that id to one of your carousel elements, right? With your code, I’m only getting one page with the id defined at that level. If you move it down you will see three pages.

    defaults: {
       styleHtmlContent:true,  
       id:'mypanel'  // IN WRONG PLACE?
    },
    
    

    [UPDATE]

    I got it working so that you can write to any of your carousel panels. I just created a direct reference to each id in the refs:{} section. I’m drawing to the second page so drag it into view to see the updates.

    Also, I’m adding the model, store, and app.js so that anyone reading this will have a complete working example.

    Ext.define('MyApp.controller.MeniuController', {
        extend:'Ext.app.Controller',
        config:{
            refs:{
                leftMeniu:'mypanel list[id=mylist]',
    //            myPanel:'mypanel panel[id=mypanel]'
    //            myPanel:'mypanel carousel[id=mypanel]'
                myFirstPanel:'#mypanel1',
                mySecondPanel:'#mypanel2'
            },
            control:{
                leftMeniu:{
                    itemtap:'onItemTap'
                }
            }
        },
    
        onItemTap:function(list, index, item, record, e, opts) {
            var content = '<h2>' + record.get('label') + '</h2>' + record.get('html');
            this.getMySecondPanel().setHtml(content);
            this.getMyFirstPanel().setHtml(content);
        }
    });
    

    Complete MyPanel View:

    Ext.define('MyApp.view.MyPanel', {
        extend: 'Ext.Panel',
        xtype:'mypanel',
    
        config: {
            ui: 'dark',
            layout: {
                type: 'card'
            },
            items: [
                {
                    xtype: 'titlebar',
                    docked: 'top',
                    title: 'Lezzet Dunyasi'
                },
                {
                    xtype: 'list',
                    docked: 'left',
                    id: 'mylist',
                    ui: 'round',
                    pinHeaders: false,
    //                grouped: true,
                    //disableSelection: true,
                    width: 331,
                    itemTpl: [
                        '{label}'
                    ],
                    store: 'Menius',
                    items: [
                        {
                            xtype: 'searchfield',
                            docked: 'top',
                            placeHolder: 'Search...'
    
                        }
                    ]
                },
    //            {
    //                xtype: 'panel',
    //                styleHtmlContent:true,
    //                style: {
    //                    backgroundImage: 'url(../images/risk2.png)',
    //                    backgroundRepeat: 'no-repeat',
    //                    backgroundPosition: 'center'
    //                },
    //                id:'mypanel'
    //            }
                {
                    xtype: 'carousel',
    
                    defaults: {
                        styleHtmlContent:true
                    },
    
                    items: [
                        {
                            html: 'Item 1',
                            style: 'background-color: #5E99CC',
                            id:'mypanel1'
    
                        },
                        {
                            html: 'Item 2',
                            style: 'background-color: #759E60',
                              id:'mypanel2'
                        },
                        {
                            html: 'Item 3'
                        }
                    ]
                }
            ]
        }
    });
    

    app.js

    Ext.application({
        name: "MyApp",
    
        views: ['MyPanel'],
        models: ['Meniu'],
        stores: ['Menius'],
        controllers: ['MeniuController'],
        launch: function() {
    
            Ext.Viewport.add(Ext.create('MyApp.view.MyPanel'));
        }
    });
    

    Model:

    Ext.define('MyApp.model.Meniu', {
        extend: 'Ext.data.Model',
    
        config: {
            fields: ['img_url', 'label', 'html']
        }
    });
    
    

    Store:

    Ext.define('MyApp.store.Menius', {
        extend: 'Ext.data.TreeStore',
    
        config: {
            model: 'MyApp.model.Meniu',
            defaultRootProperty: 'items',
            grouper: function(record) {
                return record.get('label')[0];
            },
            root: {
                text: 'foo',
                items: [
    
                    {img_url: 'foo.png', label: 'one', html:'

    nice

    ', leaf: true}, {img_url: 'foo.png', label: 'two', html:'

    carousels

    ', leaf: true} ] } } });
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently just starting my first Lua program and I have a .csv file
I have tried to write my first Boost program from information on the Boost
Hey all i have two JFrames one is my main login frame, user enters
Hi; I have 4 tables, one of them is main table also there is
Simple synopsis: I have a program which needs authentication from user to get access
Let me first describe my situation. I have a list of Hex values, which
I'm creating a Linked List program and I currently have this method to insert
I wrote my first program almost fifty years ago (yes, coding is still a
I am making my first program with beautifulsoup and my html file has code
I don't understand why the first program in JSP is working, but the second

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.