It's all about the answers!

Ask a question

Adding event listener using dojo on custom attribute in ccm


0
1
Rohit Goyal (11) | asked Jul 17 '23, 12:45 a.m.

 Hello,


I am trying to add an event listener on a custom attribute in ccm using dojo. I came to know that we have WorkItemAttributes, but that restricts the user to only fetch internal/system attributes. Could you please help me on how can I attach an on change event handler to a radio button (enumeration) in CCM using dojo?

Regards,
Rohit Goyal

One answer



permanent link
haseeb alam (91) | answered Jul 17 '23, 3:44 p.m.
Hi Rohit,
Try this.. on function to attach the event listener to the radio button element.

require(["dojo/query", "dojo/on", "dojo/domReady!"], function(query, on) {
  // Replace "radioButtonID" with the unique ID or class of your radio button element
  var radioButton = query("#radioButtonID")[0];

  // Attach the event listener to the radio button
  on(radioButton, "change", function() {
    // Access the selected value of the radio button
    var selectedValue = radioButton.value;

    // Perform your desired actions based on the selected value
    // For example, you can log the selected value to the console
    console.log("Selected value: " + selectedValue);
  });
});
I hope it help you.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.