// retrieve all direct children which are Ext.Panels within myCt
var directChildPanel =Ext.ComponentQuery.query('#myCt > panel');

And rewriting it to be something like:

Code:

//maybe this works where it retrieves all direct children which are Ext.Buttons within Desk.view.Case and then [1] to pick out the second button
var button2 = Ext.ComponentQuery.query('casesPanel > button')[1];

// retrieve all direct children which are Ext.Panels within myCt
var directChildPanel =Ext.ComponentQuery.query('#myCt > panel');

And rewriting it to be something like:

Code:

//maybe this works where it retrieves all direct children which are Ext.Buttons within Desk.view.Case and then [1] to pick out the second button
var button2 = Ext.ComponentQuery.query('casesPanel > button')[1];