Expand my Community achievements bar.

SOLVED

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

Avatar

Level 3

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

1 Accepted Solution

Avatar

Correct answer by
Administrator

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

View solution in original post

2 Replies

Avatar

Level 10

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.

Avatar

Correct answer by
Administrator

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