3

I know that

component.find(AURA:ID_VALUE);

will work, but does anyone know if there is a way to do a find by type instead of id? What I am referring to would look similar to

component.find("ui:inputcheckbox");
  • I'm pretty sure there's no mechanism for this. You'd want to use aura:id, or even better, using attributes. – sfdcfox Oct 18 '17 at 16:38
  • I am afraid that it is possible with any recommended way, I guess it is by design and also due to locker service. For me document.getElementByClassName works sometimes and not! – Raul Oct 18 '17 at 16:39
  • Look at this solution, it might help – Praveen Oct 18 '17 at 16:42
2

According to this documentation (page 110) this syntax should work:

var checkboxes = component.find({ instancesOf : "ui:inputCheckbox" });
  • 1
    It won't work looks like there's a bug in the framework. Please refer the answer tagged in the comment. – Praveen Oct 18 '17 at 17:03
  • Hmm thanks, good to know, just another lightning bug :( – Basti Oct 18 '17 at 17:34
  • 1
    Even though this is currently bugged, I will mark this as the answer because this is exactly what I as looking for. – rStrunk Oct 18 '17 at 18:10

Not the answer you're looking for? Browse other questions tagged or ask your own question.