I have a weird issue with some code I'm writing. on tap I'm doing:
inSender.addClass("selected");
And the dom element is getting styled as I expect, but:
console.log(inSender.classes)
isn't showing the "selected" class. And when I try to remove the class later, nothing happens to the dom element. I can see the node in the enyo.instance object and it has selected listed as a class, but the classes property doesn't.
I was originally using a Scroller and adding the elements using create component, which was working fine. I decided to switch to a List since the scroller didn't perform well on the touchpad. and this problem creeped up.
Any suggestions on where I should look?
0 ·
Comments
You need to use calls to prepareRow() and lockRow() around any manipulation in order for this to work outside of the onSetupRow handler.
Thanks
prepareRow
andlockRow
are for more specialized cases.Fwiw, ironically, List has a selection mechanism built in. To use that all you need to do is this:
I'm going to try your suggested by storing off the prior selected index and call renderRow on that.
The implementation is simply: