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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:04:25+00:00 2026-05-31T07:04:25+00:00

I have this following code and i want to display images and other html

  • 0

I have this following code and i want to display images and other html elements as items of the nested list.

Can this be achieved?

My code is

Ext.setup({
    tabletStartupScreen: 'tablet_startup.png',
    phoneStartupScreen: 'phone_startup.png',
    icon: 'icons/logo4_1.png',
    glossOnIcon: false,

    title: 'Item List',
    fullscree: true,
    onReady: function() {

        var data = {
            title: 'Item List',
            text: 'Groceries',
            items: [{
                text: 'Beverages',
                imgURL: '\images\beverage\colas.jpg',
                items: [{
                    text: 'Water',
                    imgURL: '\images\beverage\colas.jpg',
                    items: [{
                        text: 'Sparkling',
                        imgURL: '\images\beverage\colas.jpg',
                        leaf: true
                    }, {
                        text: 'Still',
                        imgURL: '\images\beverage\colas.jpg',
                        leaf: true
                    }]
                }, {
                    text: 'Coffee',
                    imgURL: '\images\beverage\colas.jpg',
                    leaf: true
                }, {
                    text: 'Espresso',
                    imgURL: '\images\beverage\colas.jpg',
                    leaf: true
                }, {
                    text: 'Redbull',
                    imgURL: '\images\beverage\colas.jpg',
                    leaf: true
                }, {
                    text: 'Coke',
                    imgURL: '\images\beverage\colas.jpg',
                    leaf: true
                }, {
                    text: 'Diet Coke',
                    imgURL: '\images\beverage\colas.jpg',
                    leaf: true
                }]
            }, {
                text: 'Fruits',
                imgURL: '\images\beverage\colas.jpg',
                items: [{
                    text: 'Bananas',
                    imgURL: '\images\beverage\colas.jpg',
                    leaf: true
                }, {
                    text: 'Watermelon',
                    imgURL: '\images\beverage\colas.jpg',
                    leaf: true
                }, {
                    text: 'Grapes',
                    imgURL: '\images\beverage\colas.jpg',
                    items: [{
                        text: 'Black Grapes',
                        leaf: true
                    }, {
                        text: 'Green Grapes',
                        leaf: true
                    }]
                }, {
                    text: 'Pear',
                    imgURL: '\images\beverage\colas.jpg',
                    leaf: true
                }, {
                    text: 'Apple',
                    imgURL: '\images\beverage\colas.jpg',
                    leaf: true
                }]
            }, {
                text: 'Bread and Bakery',
                imgURL: '\images\beverage\colas.jpg',
                items: [{
                    text: 'Bread',
                    imgURL: '\images\beverage\colas.jpg',
                    items: [{
                        text: 'White Bread',
                        imgURL: '\images\beverage\colas.jpg',
                        leaf: true,
                    }, {
                        text: 'Brown Bread',
                        imgURL: '\images\beverage\colas.jpg',
                        leaf: true,
                    }, {
                        text: 'Sandwich Bread',
                        imgURL: '\images\beverage\colas.jpg',
                        leaf: true,
                    }]
                }, {
                    text: 'Pretzels',
                    imgURL: '\images\beverage\colas.jpg',
                    leaf: true
                }, {
                    text: 'Cup Cakes',
                    imgURL: '\images\beverage\colas.jpg',
                    leaf: true
                }]
            }, {
                text: 'Personal Care',
                imgURL: '\images\beverage\colas.jpg',
                items: [{
                    text: 'Shampoo',
                    imgURL: '\images\beverage\colas.jpg',
                    items: [{
                        text: 'Dove',
                        imgURL: '\images\beverage\colas.jpg',
                        leaf: true,
                    }, {
                        text: 'Sunsilk',
                        imgURL: '\images\beverage\colas.jpg',
                        leaf: true,
                    }, {
                        text: 'Garnier',
                        imgURL: '\images\beverage\colas.jpg',
                        leaf: true,
                    }]
                }, {
                    text: 'Soaps',
                    imgURL: '\images\beverage\colas.jpg',
                    items: [{
                        text: 'Dove',
                        imgURL: '\images\beverage\colas.jpg',
                        leaf: true,
                    }, {
                        text: 'Pears',
                        imgURL: '\images\beverage\colas.jpg',
                        leaf: true,
                    }, {
                        text: 'Lux',
                        imgURL: '\images\beverage\colas.jpg',
                        leaf: true,
                    }]
                }, {
                    text: 'Hair Oil',
                    imgURL: '\images\beverage\colas.jpg',
                    items: [{
                        text: 'Vatika',
                        imgURL: '\images\beverage\colas.jpg',
                        leaf: true,
                    }, {
                        text: 'Almond Oil',
                        imgURL: '\images\beverage\colas.jpg',
                        leaf: true,
                    }, {
                        text: 'Parachute Coconut oil',
                        imgURL: '\images\beverage\colas.jpg',
                        leaf: true,
                    }]
                }, {
                    text: 'Body Lotions',
                    imgURL: '\images\beverage\colas.jpg',
                    items: [{
                        text: 'Dove',
                        imgURL: '\images\beverage\colas.jpg',
                        leaf: true,
                    }, {
                        text: 'Ponds',
                        imgURL: '\images\beverage\colas.jpg',
                        leaf: true,
                    }, {
                        text: 'Nivea',
                        imgURL: '\images\beverage\colas.jpg',
                        leaf: true,
                    }]
                }]
            }]
        };

        Ext.regModel('ListItem', {
            fields: ['text', 'imgURL'],
            //fields: [{name: 'text', type: 'string'},{name: 'imageURL', type: 'string'}],

        });

        var store = new Ext.data.TreeStore({
            model: 'ListItem',
            root: data,
            proxy: {
                type: 'ajax',
                reader: {
                    type: 'tree',
                    root: 'items'
                }
            }
        });

        var leftNav = new Ext.NestedList({
            fullscreen: true,
            dock: 'left',
            useTitleAsBackText: true,
            title: 'Item List',
            icon: 'icons/logo4_1.png',
            itemTpl: '<img src="{imgURL}" width="100" heigh="100"></img><span>{text}</span> <span><button>Add to Cart</button>',
            width: '350',
            image: 'image',
            dockedItems: [{
                html: '<img src="icons/logo4_1.png" width="100" height="40"/>',
                dock: 'top',
            }],
            store: store,
        });

        new Ext.Panel({
            fullscreen: true,

            layout: {
                type: 'vbox',
                align: 'stretch'
            },
            defaults: {
                flex: 1
            },
            dockedItems: [leftNav]
        });
        if (Ext.is.Phone) {
            fullscreen: true;
        }
    }
});

Though am using the imgURl field its not working.

Plz help.. Answers appreciated..!

  • 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-05-31T07:04:27+00:00Added an answer on May 31, 2026 at 7:04 am

    You need to set the template of your nested list items. You can do it by adding a getItemTextTpl attribute to you nested list config

    getItemTextTpl: function(node){
        return '{imgURL} - {text}';
    } 
    

    You can take a look at how I used getItemTextTpl in this question

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

Sidebar

Related Questions

I have the following code: foreach (var control in this.Controls) { } I want
I have the following code (in this case for two images - but in
I have the following code to do this, but how can I do it
I have following code in my MVC2 view: <tr class=edit style=display:none> <td> <%= Html.DropDownList(drpFields,
I have following code in my MVC2 view: <tr class=edit style=display:none> <td> <%= Html.DropDownList(drpFields,
I have the following code: <a href=main.html class=admin><div class=buttonlabel>Admin</div></a> and CSS a.admin { display:block;
in folder i have following images w1.jpg,w2.jpg...... w7.jpg, now i have this code for
I have this following code, here CssClass is of the String type. <asp:Panel ID=Panel1
I have this following code which will return all the current semesters. How do
I have this following jquery text fly-in animation.Here is my code before I explain

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.