PDA

View Full Version : how to get component property and config details when mouseover specific component



Periyasamy A
12 Oct 2012, 10:47 AM
how to get component properties and config details when mouseover/click/focus specific component

scottmartin
12 Oct 2012, 12:50 PM
Is this for debugging question, or do you need this in you app?

vietits
12 Oct 2012, 4:51 PM
Try this:


function mouseOver(event, el){
var cmp = Ext.getCmp( el.id.replace(/-[a-z]+$/i, '') );
console.log(cmp);
}

Periyasamy A
13 Oct 2012, 7:45 AM
my requirement is get clicked component (properties and config details )as JSON string and update the properties to respective component, when click the component


function mouseClick(event, el){ var cmp = Ext.getCmp( el.id.replace(/-[a-z]+$/i, '') );// Here i need to get component config details as JSON sting and same way update t he details from here console.log(cmp); }

vietits
13 Oct 2012, 4:01 PM
My example shows how to get component on 'mouseover' event on one of its HTML element. It will be the same for 'click' event. When you have component, you can get any of its properties. About the config, it seems you can not get the initial config if you have not saved it before constructing the component. Some items from the config will be copied to the component but some items will be ignored or overrided during the time of constructing component.