PDA

View Full Version : How to use control query on invisible elements



filippo.ferrari
31 Oct 2013, 3:03 AM
I have 3 'menuitem', I collect a reference to menuitems with this controquery: item.up('menu').down('menuitem') ... starting point (item) is one of the menuitems

Once is clicked I want hide menuitem and I do it so: item.setVisible(false);

Problem is that my collection of menuitems are made only with visible items. I need a collection of all menuitems.

Regards

scottmartin
4 Nov 2013, 1:33 PM
You may have to adjust the focusable check in the code:



focusable: function(cmps) {
var len = cmps.length,
results = [],
i = 0,
c;

for (; i < len; i++) {
c = cmps[i];
// If this is a generally focusable Component (has a focusEl, is rendered, enabled and visible)
// then it is currently focusable if focus management is enabled or if it is an input field, a button or a menu item
if (c.isFocusable()) {
results.push(c);
}
}

return results;
},

filippo.ferrari
5 Nov 2013, 12:12 AM
You may have to adjust the focusable check in the code:



focusable: function(cmps) {
var len = cmps.length,
results = [],
i = 0,
c;

for (; i < len; i++) {
c = cmps[i];
// If this is a generally focusable Component (has a focusEl, is rendered, enabled and visible)
// then it is currently focusable if focus management is enabled or if it is an input field, a button or a menu item
if (c.isFocusable()) {
results.push(c);
}
}

return results;
},


I'have to remove isFocusable control?

//if (c.isFocusable()) {
results.push(c);
//}

and how to override it? I'have to override Ext.dom.Query?

scottmartin
5 Nov 2013, 5:25 AM
Well crap .. it seems Ext.dom.Query is a anonymous closure.

You would have to create a separate file with the function and make the changes direct