PDA

View Full Version : Ref problems on 4.2.3



intro
23 Jan 2015, 2:30 AM
Hi Just want to check if anyone had error with componentquery after update to 4.2.3.

For example I have element button

{ xtype: 'form',
height: 143,
bodyPadding: 10,
title: 'My Form',
items: [
{
xtype: 'button',
itemId: 'test',
text: 'Test'
}
]
}

and I want to make ref to it from controller.


init: function() {
this.control({
button [itemId=test]': {
click: ‘handleChange’
})
handleChange :function(element){
element.up(‘form’); // Here is the problem I can not reference this, it gives me error on filterById in ComponentQuery..in any situation if I am trying to get element with up and down I can not get the element
}


Thanks

joel.watson
23 Jan 2015, 12:26 PM
Hi intro--

Make sure that you have a valid selector. If you're going to use the itemId selector, remove the space between "button" and "[itemId=test]". Also make sure that you properly quote the selector string.

As a shortcut, however, you don't have to use "[itemId=xyz]". You can just do "#xyz", as in "button#xyz".

I've put together a fiddle below demonstrating both approaches working as expected.

I hope that helps--thanks!
Joel

h19