Problem occur when same dialog-ready function get invoked on 2 different dialog load | Community
Skip to main content
New Participant
June 15, 2016
Solved

Problem occur when same dialog-ready function get invoked on 2 different dialog load

  • June 15, 2016
  • 2 replies
  • 864 views

Hi,

We have a scenario where we are using extraClientlibs to perform event handling for the Touch UI component dialog. To invoke the custom function, we wrote 

$document.on("dialog-ready", function() {    

getAdaptiveData();

}

in one of the JS  but we found that irrespective of the component , this function get invoke everytime on any dialog load.

Can anyone help us as how we can achieve a scenario where only component specific JS get invoked which in turn only invoke defined "dialog-ready" .

Regards,

Shikha

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by kautuk_sahni

As mentioned by Scott and Lokesh, 

You can trigger the event based on specifics. Let say you want to trigger something on specific component/div/p/a etc. You need to differentiate it from others. Once you have them, then trigger the event on the specifics.

Is normal JQuery that can trigger the events. It just adding a specific logic to prevent others.

CSS Selector (http://www.w3schools.com/cssref/css_selectors.asp) can come handy in this case too.

I hope this would be helpful.

Thanks and Regards

Kautuk Sahni

2 replies

kautuk_sahni
kautuk_sahniAccepted solution
Employee
June 16, 2016

As mentioned by Scott and Lokesh, 

You can trigger the event based on specifics. Let say you want to trigger something on specific component/div/p/a etc. You need to differentiate it from others. Once you have them, then trigger the event on the specifics.

Is normal JQuery that can trigger the events. It just adding a specific logic to prevent others.

CSS Selector (http://www.w3schools.com/cssref/css_selectors.asp) can come handy in this case too.

I hope this would be helpful.

Thanks and Regards

Kautuk Sahni

Kautuk Sahni
Lokesh_Shivalingaiah
New Participant
June 15, 2016

Hi Shikha,

"dailog-ready" is a generic event which would be invoked irrespective of which component dialog you start. To avoid it, you might have to add an extra check or a logic to find a particular field as @scott mentioned.