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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:52:43+00:00 2026-06-17T04:52:43+00:00

1)I have a json file which I want to display in view. { contents:

  • 0

1)I have a json file which I want to display in view.

{           
    "contents": [
                {
                    "title":'JWorld',
                    "image":'image/e-learning/elearning.png',

                    "subtitle":[
                    {
                        "categories":'Aus',
                    },
                    {
                        "categories":'England',
                    }                
                    ]
                },
                {
                    "title":'JIndia',
                    "image":'image/Content/History_of_India.jpg',
                    "subtitle":[
                    {
                        "categories":'History',
                    },
                    {
                        "categories":'India palace',
                    }                
                    ]
                },
                {
                    "title":'JMaharastra',
                    "image":'image/Content/Geography.jpg',
                    "subtitle":[
                    {
                        "categories":'History Maharastra',
                    },
                    {
                        "categories":'Maharastra Heros',
                    }                
                    ]
                }
              ]
}

2)My view file :–

Ext.define('Balaee.view.kp.dnycontentcategories.ContentcategoriesView',
{
    extend:'Ext.view.View',
    id:'contentcategoriesViewId',
    alias:'widget.ContentcategoriesView',
    store:'kp.DnycontentcategoriesStore',
    config:
    {
        tpl:'<tpl for="0">'+
                '<div class="main">'+
                '</br>'+
                '<b>{title}</b></br>'+
                '<img src={image} hight="50" width="100"></br>'+
                '</div>'+
                '</tpl>',
        itemSelector:'div.main',
    }
});// End of class

3) i am using tab panel and dynamically adding tabs in it using json file.

Ext.define('Balaee.view.kp.dnycontentcategories.Contentcategories',{
    extend:'Ext.tab.Panel',
    requires:[
              'Balaee.view.kp.dnycontentcategories.ContentcategoriesView','Balaee.view.kp.dnycontentcategories.ContentcategoriesView1'
             ],
    id:'contentcategoriesId',
    alias:'widget.Contentcategories',
    height:500,
    items:[

    ],//end of items square
});// End of login class

4) My store file:–

Ext.define('Balaee.store.kp.DnycontentcategoriesStore',{
    extend: 'Ext.data.Store',
    model: 'Balaee.model.kp.DnycontentcategoriesModel',
    autoLoad:true,
//    filters: [{
//        property: 'title',
//    }],
    proxy:
    {
        type:'ajax',
        api:
        {
            read:'data/content.json',
            //create: ,
            //update: ,
            //destroy: ,
        },//End of api 
        reader:
        {
            type:'json',
            root:'contents',
            //successProperty: ,
        }//End of reader
    }//End of proxy
});//End 

5) My Controller file some code
here I am dynamically adding some tabs from json file.And selecting particular tab I want different particular values from json file. But I get same view of first tab. How can I solve this problem.

init: function(){
    console.log("inside content controller");
    this.control({
        'Contentcategories':
        {
            render:this.renderFunction,
        }
    });//End of control
},//End of init() function
renderFunction:function(){
    console.log("Inside render function");
    var tabPanel = Ext.getCmp('contentcategoriesId');       // tabpanel  
    var tabPanelView = Ext.getCmp('contentcategoriesViewId');   // tabpanel view

    var storeObject= this.getStore('kp.DnycontentcategoriesStore'); // store
    storeObject.on('load',function(){
        storeObject.each(function(model){
            //tabPanelView.store().filter('title',model.get('title')),
            console.log(model.get('title'));
            console.log(model.get('categories'));
            tabPanel.add({title:model.get('title'),
                            id:model.get('title'),
                            //html:"<image src=model.get('image')>",
                            xtype:'ContentcategoriesView',              
                        }); //End of add function 
        });// End of storeObject function
        tabPanel.setActiveTab(0);
    });
},// End of render function 

please give me some suggestion.

  • 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-17T04:52:44+00:00Added an answer on June 17, 2026 at 4:52 am

    There are a few issues with your code.

    You define ContentcategoriesView – its a a component you have extended; but you give it an id (contentcategoriesId) yet you are creating more than one of these components – it makes no sense as an id has to be unique per component instance.

    Then, you attach a store to this view, which means all components will render the same.

    If I understand correctly you want each entry in your json to become a different tab.

    I would take this direction (code not tested, but should give you a direction):

    Ext.define('Balaee.view.kp.dnycontentcategories.ContentcategoriesView',
    {
        extend:'Ext.panel.Panel', // Notice it's a panel.
        alias:'widget.ContentcategoriesView',
    
        config:
        {
            tpl: '<div class="main">' +
                 '</br>' +
                 '<b>{title}</b></br>' +
                 '<img src={image} hight="50" width="100"></br>' +
                 '</div>'
            itemSelector:'div.main',
        }
    });
    

    And then:

    storeObject.on( 'load',function() {
        storeObject.each( function( model ) {
            tabPanel.add({
                xtype: 'ContentcategoriesView',
                title: model.get( 'title' ),
                id:    model.get( 'title' ),
                data:  model
            }); 
        });
        tabPanel.setActiveTab(0);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JSON file which contains HTML content. I want to load it
I have a pickerview with which I would want to display values using JSON
I have an XML file which I want to convert into JSON file using
I have JSON data which come from server. I want to display organization chart
I have a JSON file which contains a pound symbol in it. This json
I have parse json file which contain more than hundred location name, there latitude
I have a JSON string (external file) which has an element which can either
I have a flash file which loads data from JSON and parses it. It
I have a JSON file and want to parse value of variable second value
I have a large JSON file which is essentially a huge array filled with

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.