3
I have a third system that fills a field through a zoom. Below this zoom I have a product grid (my specific). I need to include a product in this grid whenever the system fills this product field. However, there is no customization point that can intercept the moment the product is selected at zoom.
The question is: How to detect that the field value has been changed (remembering that it is changed via javascript)? I have tried using the events: bind
and on
of jquery without success. Another alternative gambiarrenta was to use a settimeout
. For now I’m looking for a more elegant way out to solve such a situation.
Someone’s been through something like this?
You can use the event
change
, if I understand your problem well. Can you put the HTML of that(s) field(s)? A live example on jsFiddle would be ideal to understand better.– Sergio
I tried to use the change event. However, as the field is changed via js and not by the user apparently is ignored
– Emir Marques
And the JS code that changes the value is not yours?
– Sergio
http://jsfiddle.net/emirdeliz/26v6urLw/
– Emir Marques
It’s not. A third party system is responsible for zooming in and setting the value. Let’s say I’m customizing a system fragment
– Emir Marques
And does the third system run on your page? Is that code exposed to global space? you could change their method that applies the change of value... half gross, but otherwise I think it’s really the
setTimeout
... Something like this: http://jsfiddle.net/26v6urLw/4/– Sergio
I tested the code sent by @Sergio and went, I even added a function that changes the code on the click and triggered the event... see here
– h3nr1ke