Skip to content Skip to sidebar Skip to footer

Dojo: Getting Access To The Clicked Item In A Dijit.form.select?

I have a dijit Select widget and need to do something when the user clicks one of the dropdown items. Meaning I need access to the clicked item, to retrive some information, and ca

Solution 1:

Have a look at my answer to onChange not sufficient to trigger query from Dojo Combobox and also to jsFiddle mentioned there. I added code specific for your needs there:

select.dropDown.on("itemClick", function(dijit, event) {
    var node = dijit.domNode;
    console.log(domAttr.get(node, "data-info-attribute"));
    // or
    console.log(node.dataset.infoAttribute);
});

Post a Comment for "Dojo: Getting Access To The Clicked Item In A Dijit.form.select?"