PDA

View Full Version : 'ref' buttons by classname (in a controller)



jeanluca
17 Sep 2012, 11:59 PM
Hi

I have two logout buttons (each on a different panels), for which I want to do something when they're tapped. I have added a class value of 'logout' to both of them and the following controller setup:



.....
ref: {
logoutButtons: 'button[class~="logout"]' // should match both buttons
},
control: {
logoutButtons: {
tap: 'onLogout'
}
}
....

Well, this doesn't work, any suggestions how to fix this ?

Thanks
Luca

netresource
18 Sep 2012, 1:24 AM
you can do below

refs: {
logoutButton:{
selector: '[cls="logout"]'
}
},
control: {
logoutButton:{
tap: 'onLogoutTap'
}
}

jeanluca
18 Sep 2012, 1:48 AM
check, it works now! Thanks a lot!!