Solved

Call Javascript on SmartObject List

  • 21 March 2018
  • 2 replies
  • 18 views

Userlevel 3
Badge +5

I'm stumped on how to trigger or trap an event out of K2.

 

I have a view with a Google Map, the user types in a Lat and Long and I have some custom Javascript which traps the change event and moves a marker on the map to the desired location.

 

The user also has an Autocomplete on my location table. The autocomplete does a Transfer Data to set the same Lat and Long text boxes. The problem is updating a text box with a K2 rule (or any javascript update) doesn't trigger the change event. Is there a way to trigger a custom javascript event on a Transfer Data or similar rule?

 

I tried listening to ajaxComplete but got nothing.

icon

Best answer by boringNerd1 22 March 2018, 04:02

View original

2 replies

Badge +15

Hi,


 


The only solution that I can think of for this is to manually trigger the javascript yourself after you executed the rule to transfer the data to your 2 text boxes.


 


You can follow the steps listed here to execute the javascript manually.

Userlevel 3
Badge +5

I did not know that injecting a script into a blank field (repeatedly) would run the script! Excellent.

Reply