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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:50:25+00:00 2026-05-22T18:50:25+00:00

My grid isnt showing data when put to tab. This grid, store, model, JSON

  • 0

My grid isnt showing data when put to tab. This grid, store, model, JSON are working when renderd to body or div, or as a part of a viewport. Only not showing when put in tab, that is also created using JSON and Tree! This is a (sometimes)working example. I cant figure it out, maybe scope bug … Please help!

Ext.Loader.setConfig({ enabled: true });
Ext.require(['*']);
Ext.require('app.kontakt');
Ext.require('app.ponude');
Ext.require('app.gridStore');
Ext.onReady(function() {


Ext.create('Ext.Viewport', {
    layout: {
        type: 'border',
        padding: 5
    },
    defaults: {
        split: true
    },
    items: [{
        region: 'north',
        collapsible: false,
        split: true,
        height: 60
    },{
        region: 'west',
        collapsible: false,
        title: 'IZBORNIK',
        split: true,
        width: 200,
        layout: 'fit',
        items:[
       myTree
         ]

    },{
     region: 'center',
        layout: 'fit',
        border: false,
        items: [{
            xtype:'tabpanel',
            id:'mainTabPanel'
        }]
    }]
  });
});

var store = Ext.create('Ext.data.TreeStore', {
proxy: {
        type: 'ajax',
        url: 'app/myTree.json',
        },
reader: {
            type: 'ajax',
            root: 'nodes',
            record: 'leaf'
        }

});     

 var myTree = Ext.create('Ext.tree.Panel', {
 store: store,
 rootVisible: false,   
border: false,
listeners:{
    itemclick: function(view,record,item,index,e){

        if(record.isLeaf() && record.raw.tabCls){

            var tabId=record.raw.tabId;
            var mainPanel = Ext.getCmp('mainTabPanel');
            var existingTab = Ext.getCmp(tabId);

            if(existingTab){

                mainPanel.setActiveTab(existingTab);

            }else{

                mainPanel.add(Ext.create(record.raw.tabCls,{id:tabId})).show(); 
            }
        }
    }
}
});

Ext.define("app.kontakt",{
extend:"Ext.panel.Panel",
name:"kontakt",
title:"Kontakt",
layout:"border",
closable:true,
border: false,
items:[
        {
        region: 'north',
        collapsible: false,
        split:true,
        layout:"fit",
        height: 100,
        border: false,
        buttons: [{
            text: 'Load1',
            handler:function(){

                myStore.load({
                        scope : this,
                        url : 'app/kontaktGrid.json'
                });

            }
            },{
            text: 'Load2',
            handler:function(){

                myStore.load({
                        scope : this,
                        url : 'app/kontaktGrid1.json'
                });

            }
            }]              
        },{
        region: "center",
        xtype:"grid",
        id:"kontaktGrid",
        layout: "fit",
        store: myStore,
        border: false,
        columns: [
                {header: 'name',  dataIndex: 'name',flex:1},
                {header: 'email', dataIndex: 'email', flex:1},
                {header: 'phone', dataIndex: 'phone', flex:1}
            ]  
        }           
    ]       
});

Ext.define('app.gridStore', {
extend: 'Ext.data.Model',
fields: [
    'name', 'email', 'phone'
]
});

var myStore =Ext.create('Ext.data.Store', {
model: 'app.gridStore',
proxy: {
    type: 'ajax',
    url : '',
    reader:{ 
        type:'json',
        root: 'items'
    }
},
autoLoad:false


});

JSON for TREE

{

    children: [
        { text:"KLIJENTI", expanded: true,
            children: [{ text:"Kontakt", leaf: true , tabId : "tab1", tabCls: "app.kontakt"}]
        }

    ]
}

JSON for GRID

{'items':[
    {"name":"Lisa", "email":"lisa@simpsons.com", "phone":"555-111-1224"},
    {"name":"Bart", "email":"bart@simpsons.com", "phone":"555--222-1234"}
]}
  • 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-22T18:50:26+00:00Added an answer on May 22, 2026 at 6:50 pm

    ok… i have tes your code just by copy paste to my firebug (of course with edit the json urls),
    and i got an error…. This is because the program flow…
    if it was your script, and put them in a single file, you specify a grid before the store

    here code works for me no error…

    Ext.onReady(function () {
    
        Ext.create('Ext.Viewport', {
            layout: {
                type: 'border',
                padding: 5
            },
            defaults: {
                split: true
            },
            items: [{
                region: 'north',
                collapsible: false,
                split: true,
                height: 60
            }, {
                region: 'west',
                collapsible: false,
                title: 'IZBORNIK',
                split: true,
                width: 200,
                layout: 'fit',
                items: [myTree]
    
            }, {
                region: 'center',
                layout: 'fit',
                border: false,
                items: [{
                    xtype: 'tabpanel',
                    id: 'mainTabPanel'
                }]
            }]
        });
    });
    
    var store = Ext.create('Ext.data.TreeStore', {
        proxy: {
            type: 'ajax',
            url: 'myTree.json',
        },
        reader: {
            type: 'ajax',
            root: 'nodes',
            record: 'leaf'
        }
    
    });
    
    var myTree = Ext.create('Ext.tree.Panel', {
        store: store,
        rootVisible: false,
        border: false,
        listeners: {
            itemclick: function (view, record, item, index, e) {
    
                if (record.isLeaf() && record.raw.tabCls) {
    
                    var tabId = record.raw.tabId;
                    var mainPanel = Ext.getCmp('mainTabPanel');
                    var existingTab = Ext.getCmp(tabId);
    
                    if (existingTab) {
                        mainPanel.setActiveTab(existingTab);
                    } else {
                        mainPanel.add(Ext.create(record.raw.tabCls, {
                            id: tabId
                        })).show();
                    }
                }
            }
        }
    });
    
    
    
    Ext.define('app.gridStore', {
        extend: 'Ext.data.Model',
        fields: ['name', 'email', 'phone']
    });
    
    var myStore = Ext.create('Ext.data.Store', {
        model: 'app.gridStore',
        proxy: {
            type: 'ajax',
            url: '',
            reader: {
                type: 'json',
                root: 'items'
            }
        },
        autoLoad: false
    });
    
    Ext.define("app.kontakt", {
        extend: "Ext.panel.Panel",
        name: "kontakt",
        title: "Kontakt",
        layout: "border",
        closable: true,
        border: false,
        items: [{
            region: 'north',
            collapsible: false,
            split: true,
            layout: "fit",
            height: 100,
            border: false,
            buttons: [{
                text: 'Load1',
                handler: function () {
                    myStore.load({
                        scope: this,
                        url: 'grid.json'
                    });
                }
            }, {
                text: 'Load2',
                handler: function () {
    
                    myStore.load({
                        scope: this,
                        url: 'grid1.json'
                    });
    
                }
            }]
        }, {
            region: "center",
            xtype: "grid",
            id: "kontaktGrid",
            layout: "fit",
            store: myStore,
            border: false,
            columns: [{
                header: 'name',
                dataIndex: 'name',
                flex: 1
            }, {
                header: 'email',
                dataIndex: 'email',
                flex: 1
            }, {
                header: 'phone',
                dataIndex: 'phone',
                flex: 1
            }]
        }]
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The grid display all information correctly, In the event dataGridView1cellFormatting I change the backcolor
I have an ExtJS grid on a web page and I'd like to save
I have a Property Grid in C#, loading up a 'PropertyAdapter' object (a basic
We use a grid control from Infragistics at work. Are there others? Pay or
I have two different grid controls on the same form. They share the same
I created a grid in procedural code on my WPF page. Now I want
I am overriding a Grid, adding some customer features. One of the features is
We use Grid Control 10.2.0.4, with a catalog repository database also at 10.2.0.4. It
WPF GridSplitter makes my Grid wider than my Window! I've got a WPF Grid
I've got a grid (dojox.grid v1.2) that I don't want to be sortable. How

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.