Can skuid.events.subscribe listen to arbitrary javascript/jQuery events?

  • 1
  • Question
  • Updated 2 years ago
I see from skuid documentation that you can subscribe to standard events. Got it. 
It also says that you can subscribe to 'custom events' and then shows an example by registering a component. 

I don't quite understand this. If I want to listen for a click on a certain element, can I do it with this function, or should I use javascripts native eventListener method?

The source for my event is a jQuery. My code is below. I've tested the jQuery selector in the console and it's working but when I click on the "Last Month" action item, nothing gets logged (although other action framework events associated with the action item do work). I'm using an the snippet type is 'In-line.'


$ = skuid.$;skuid.events.subscribe(

$(".nx-actionselect-dropdown-item:contains('Last Month')").click(),

function(){

console.log('Last Month Has Been Clicked!');

}
);


I also tried putting the event into a string "$(\".nx-actionselect-dropdown-item:contains('Last Month')\").click()",
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb

Posted 2 years ago

  • 1

Be the first to post a reply!