How to choose: by identifier, by class, through parent, find (OR children OR request or select? WTF), brothers and sisters, ComponentQuery, DOM request, CSS request, etc.
Ext.ComponentQuery.query("*") // get all Ext.ComponentQuery.query("button") // all buttons Ext.ComponentQuery.query("#myid") // all controls / components myid Ext.ComponentQuery.query("#myid", rootelement) // all controls / components myid with rootelement Ext.ComponentQuery.query("#myid,button") // all buttons or controls / components myid
How to manipulate in a tree: create, add, add, insert after this brother, go to this parent, delete, destroy, etc.
Adding a button to the View:
Ext.ComponentQuery.query("#viewId")[0].add(new Ext.Button({ text: 'test'}));
There is also insert , remove , etc. depending on the request you are requesting.
How to manipulate the screen: show, hide, fade, slide, move up, down, resize, etc.
Ext.ComponentQuery.query("button").forEach(function(button){ button.hide(); }) // hide all buttons
There is also show , disable , enable , etc. depending on the control you are requesting.
How to identify each other: find DOM.Element, knowing its Ext.Component, find Ext.Component, knowing its DOM.Element, etc.
Finding Ext.Component , knowing that its Dom.Element pretty simple, you just take the ID from the DOM element and use Ext.ComponentQuery.query("#id") . There is also Ext.select('#id') to get the object from the identifier.
With the element property, you can get the DOM:
var dom = Ext.ComponentQuery.query("button")[0].element.dom // Getting the DOM from the first button var dom2 = component.element.dom // does also work as long as component is a valid sencha touch component
What is the relationship between them: what happens to the DOM.Element if its Ext.Component is hidden / destroyed / changed / moved, what happens to the Ext.Component if its Ext.Element is hidden / destroyed / changed / moved, etc.
I think I'm not sure if you call .hide , for example, some CSS: display: none will be applied to the DOM. Inside, they can use some framework, for example jQuery , for this or the old school version of document.getElementById('id').css , etc. If you call .show , it can change to display: block or to any other type that was previously (this can be stored in the Sencha Touch class).
I do not know what will happen if the DOM element is destroyed. Probably this element too, and then the garbage collector, needs to be worked on.
If there are any other questions / something was unclear or insufficient, feel free to ask.