Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>ok... i have tes your code just by copy paste to my firebug (of course with edit the json urls),<br> 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</p> <p>here code works for me no error...</p> <pre><code>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() &amp;&amp; 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 }] }] }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload