Use Click() and Blur() with SpotfireControls

In the above graphic, when you click the ‘2’, it cycles through 1, 2, 4, and 8 decks. Each click changes the Document Property.

$('#btnChangeDecks').click(function() {
  var deckNum = $('#deckNumLabel').text();
  if (deckNum < 8) {
     deckNum *= 2;
  } else {
     deckNum = 1;
  }
  $('#deckNumLabel').text(deckNum);
  $('#286f89cf42fa42bd875acb6ac2146b54').val(deckNum);
  $('#286f89cf42fa42bd875acb6ac2146b54').blur();
});

In the above scenario, the PropertyControl is a hidden Label. We change the text using val() and then we need to blur(). This causes the Spotfire interface to update the DocumentProperty with the new value.

Technical Director at Ruths.ai

Leave a Reply

Your email address will not be published. Required fields are marked *