PDA

View Full Version : Component query on buttons works with title but not with id or action



Elfderon
14 Dec 2012, 3:35 AM
I have a very simple example.

In my view I have some items, one of them is :


title: 'Login',
iconCls: 'user',
id: 'itemId',
action: 'myAction'

Now, in my controller I want to know when this has been taped.

1. This doesn't work :


control: {
'button[action=myAction]': {
tap: 'openLoginBox'
}
}

2. This doesn't work :


control: {
'#itemId': {
tap: 'openLoginBox'
}
}

3. This works :


control: {
'button[title=Login]': {
tap: 'openLoginBox'
}
}

I just want to know why, and what I am doing wrong. I want to use ids if possible not titles.

Thank you

Elfderon
16 Dec 2012, 6:58 AM
What I have noticed is that it's not the component query that doesn't work, but the assignation of new id doesn't work.

All my items have the ids : ext-tab-1, ext-tab-2, ...., so doing :



title: 'Login',iconCls: 'user',
id: 'itemId'

doesn't assign the new id to the element.

Any clues why?

mitchellsimoens
16 Dec 2012, 7:02 AM
'button[action=myAction]' should work, in fact I use action for all my buttons and it works for me quite well.

The itemId isn't going to work because it should be looking for an id with that value.