Does ExtJ开发者_如何学PythonS provide some quick way to check whether a given component is currently visible? I would normally check css properties like display and visible but what when one of parent elements is hidden?
Try Ext.Component.isVisible()
Ext.Component.isVisible()
Will work if element was hidden by ExtJs functionality.
If parent component will be hidden (e.g. by using jquery's toggle method calling) - this will not work. So in this case I have used such check:
var el = $('#real_id'); // Id of the inner element
if($(el).is (':visible') && $(el).parents (':hidden').length === 0) {
// The element is 100% visible
}
You'll ask why do I need jQuery - the answer is simple: some things can be done more quickly with it... :)
精彩评论