Skip to content

Instantly share code, notes, and snippets.

@trozdol
Created April 7, 2015 14:17
Show Gist options
  • Select an option

  • Save trozdol/7de1184e2cd6ac7b3a39 to your computer and use it in GitHub Desktop.

Select an option

Save trozdol/7de1184e2cd6ac7b3a39 to your computer and use it in GitHub Desktop.
Sencha Touch Controller Refs Example
/*
* Sencha Touch Controller Refs Example
* Author: Shayne Trosdahl - @Trozdol
* Description: Here's some ref examples. It's not all or the only ways to this.
*/
Ext.define(AppName.controller.ControllerName, {
extend: 'Ext.app.Controller',
config: {
refs: {
/*
* REF BY ITEMID
*
* {
* xtype: 'panel',
* itemId: 'some-itemid',
* }
*/
someComponent: 'panel[itemId=some-itemid]',
/*
* REF BY CLASS
*
* {
* xtype: 'panel',
* cls: 'x-panel some-class-name another-class',
* }
*/
someComponent: 'panel[cls~=some-class-name]',
/*
* REF BY XTYPE
*
* {
* xtype: 'mypanel',
* }
*/
myPanel: 'mypanel'
},
},
init: function() { }
launch: function() { }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment