Last active
November 11, 2015 09:14
-
-
Save EmmanuelKasper/c2571ee66aa883edaf98 to your computer and use it in GitHub Desktop.
ExtJS tips
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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