Results 1 to 2 of 2

Thread: How does one get access to data and components in other tabs?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha Premium Member
    Join Date
    Apr 2011
    Posts
    167
    Vote Rating
    2
      0  

    Default How does one get access to data and components in other tabs?

    If you have one tab the needs the data or component or model from another tab, what is the best way to do that in Architect?

    Would that be done through the controller?

    What I would like to do is read the contents of the spotPrices grid and apply updates to the what grid.

    Ext.define('MyApp.view.MyStuffTabPanel', {
    extend: 'Ext.tab.Panel',


    height: 503,
    resizable: true,


    initComponent: function() {
    var me = this;


    Ext.applyIf(me, {
    items: [
    {
    xtype: 'panel',
    height: 237,
    resizable: true,
    layout: {
    type: 'fit'
    },
    title: 'What',
    items: [
    {
    xtype: 'gridpanel',
    height: 503,
    autoScroll: true,
    resizable: true,
    title: 'WhatGridPanel',
    store: 'MyWhatStore',
    viewConfig: {
    height: 503
    },
    columns: [
    {
    xtype: 'gridcolumn',
    dataIndex: 'what',
    text: 'What'
    },
    {
    xtype: 'numbercolumn',
    dataIndex: 'amount',
    text: 'Amount'
    },
    {
    xtype: 'gridcolumn',
    dataIndex: 'unit',
    text: 'Units'
    }
    ]
    }
    ]
    },
    {
    xtype: 'panel',
    height: 503,
    resizable: true,
    layout: {
    type: 'fit'
    },
    title: 'SpotPrices',
    items: [
    {
    xtype: 'gridpanel',
    height: 503,
    autoScroll: true,
    resizable: false,
    title: 'SpotPricesGridPanel',
    forceFit: true,
    store: 'MySpotPricesStore',
    viewConfig: {
    height: 503,
    autoScroll: true,
    resizable: false
    },
    columns: [
    {
    xtype: 'gridcolumn',
    maxWidth: 50,
    width: 50,
    defaultWidth: 50,
    dataIndex: 'symbol',
    text: 'Symbol'
    },
    {
    xtype: 'gridcolumn',
    maxWidth: 50,
    defaultWidth: 50,
    dataIndex: 'type',
    text: 'Type'
    },
    {
    xtype: 'gridcolumn',
    maxWidth: 50,
    defaultWidth: 50,
    dataIndex: 'currency',
    text: 'Currency'
    },
    {
    xtype: 'datecolumn',
    maxWidth: 125,
    defaultWidth: 125,
    dataIndex: 'date',
    flex: 2,
    text: 'Date',
    format: 'Y-m-d H:i:s'
    },
    {
    xtype: 'datecolumn',
    maxWidth: 125,
    defaultWidth: 125,
    dataIndex: 'time',
    flex: 2,
    text: 'Time',
    format: 'Y-m-d H:i:s'
    },
    {
    xtype: 'numbercolumn',
    maxWidth: 50,
    defaultWidth: 50,
    dataIndex: 'rate',
    text: 'Rate'
    },
    {
    xtype: 'numbercolumn',
    maxWidth: 65,
    defaultWidth: 50,
    dataIndex: 'bid',
    text: 'Bid'
    },
    {
    xtype: 'numbercolumn',
    maxWidth: 65,
    defaultWidth: 65,
    dataIndex: 'ask',
    text: 'Ask'
    },
    {
    xtype: 'numbercolumn',
    maxWidth: 65,
    defaultWidth: 65,
    dataIndex: 'high',
    text: 'High'
    },
    {
    xtype: 'numbercolumn',
    maxWidth: 65,
    defaultWidth: 65,
    dataIndex: 'low',
    text: 'Low'
    },
    {
    xtype: 'numbercolumn',
    maxWidth: 70,
    defaultWidth: 70,
    dataIndex: 'oneDayPrice',
    text: 'Onedayprice'
    },
    {
    xtype: 'numbercolumn',
    maxWidth: 85,
    defaultWidth: 85,
    dataIndex: 'oneDayChangePercent',
    text: 'PercentChange'
    },
    {
    xtype: 'numbercolumn',
    maxWidth: 80,
    defaultWidth: 80,
    dataIndex: 'oneDayChange',
    text: 'Onedaychange'
    }
    ]
    }
    ]
    },
    {
    xtype: 'panel',
    height: 503,
    resizable: true,
    title: 'Tab 3'
    }
    ]
    });


    me.callParent(arguments);
    }


    });

    Ext.define('MyApp.controller.MyStuffController', {
    extend: 'Ext.app.Controller',


    models: [
    'MySpotPricesModel'
    ]
    });
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •