cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Data Binding to a component

Former Member
0 Likes
140

Hi Researchers,

I am taking Nicholas Stein gauge component and am making some modifications on it like binding it to a datasource so that it can dynamically change the value displayed and move the Needle based on the number fetched from datasource.

I am done adding the data binding property which is now showing in the properties tab and I am able to select datasource and a single cell from the result.  My issue is that I am not able to send the value to Needle Indicator or Showed Value properties.  Initially these two values are expecting user input in design time but I am trying to set these properties during run time.

My getter/setter function looks like this:

  this.datacell = function(value) {

  if (value == undefined) {

  return datacell;

  } else {

  datacell = value;

  return this;

  }

  };

After that I am putting the afterUpdate function

this.afterUpdate = function(){

  if(_datacell){

  var Ind_value = _datacell.data;

  this.val(Ind_value)

  }

  };

I am putting this code before speedometer() function because it gives me error if I put it at the end.

I know that the values are getting set in Contribution.ZTL file

Can someone please throw some light on this as I have hit the wall now.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Hi Raj,

     In you getter/setter you are using a variable datacell then you should be using the same variable in the afterUpdate function instead of _datacell . If it doesn't help, can you please share your js code and also a link to the code you are referring from to make things more clearer.

Regards,

Stephen

Answers (0)