This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

JS to detect edition of a string
#1
Hi all,

in a JS script, I know how to detect the state of a Bool object, as

Code:
$(function(){
 
  // managing widget-20
 
  // open widget
  grp.listen('33/1/7', function(object, state) {
    if (state == 'value' && object.value == "1" ) {
        // Command to show widget
        $("#widget-20").removeClass("hide");
    }
  }, true); // set to true to execute on same object value

});


but how to detect that a String object has just been clicked (for example for modification by the user)?

Goog week !
Reply
#2
Try this:
Code:
$(function(){
  grp.listen('32/1/18', function(object, state) {
    if(state == 'init'){
      var lastvalue = object.value;
    } else {
      if (lastvalue != object.value){
        console.log('value is changed');
        // Do here other actions
        lastvalue = object.value;
      }
    }
  }, true); // set to true to execute on same object value
});
Reply
#3
Perfect , as usual Erwin !
Thank's
Reply


Forum Jump: