Skip to content

Instantly share code, notes, and snippets.

@EmmanuelKasper
Last active November 11, 2015 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EmmanuelKasper/c2571ee66aa883edaf98 to your computer and use it in GitHub Desktop.
Save EmmanuelKasper/c2571ee66aa883edaf98 to your computer and use it in GitHub Desktop.
ExtJS tips
# show or hide a component by id ( this is an HTML div id)
# <div id="north-region-container" ....
#pkmk
Ext.getCmp('north-region-container').getEl().show();
#pve
Ext.getCmp('content').getEl().show();
# Get store content of a component ( here with id 'mybuilder'
Ext.getCmp('myBuilder').store.data.items
# browse component tree by xtype, show one of them
Ext.getCmp('content').child('[xtype=PVE.dc.Config]').child('[xtype=tabpanel]').child('[xtype=pveStorageView]').show();
# Find one of them ( Ext.ComponentQuery.query returns an arry of components)
Ext.ComponentQuery.query('pveStorageView')[0].title;
Ext.ComponentQuery.query('pveDcSummary')[0].title;
# Find the items of a store
# pkmk, extjs 4
computerStore.data.items[0].data;
Object {name: "ada", hardwaretype: "vm", online: true}
# pkmk, extjs 5
computerStore.data.items[0].data
Object {name: "ada", hardwaretype: "vm", online: true, id: "computer-1"}
# Get all the events from a component:
// ExtJS4
Ext.util.Observable.capture(me, function(evname) {console.log(evname, arguments);});
// ExtJS5
Ext.mixin.Observable.capture(me, function(evname) {console.log(evname, arguments);});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment