Thursday, 15 May 2014

javascript - displaying an individual integer in webix -


I want to display one object (which changes, that's why I'm not coding it hard) I, however, does not display anything.

  var game_data = {sum: 1, yes_left: 3, nos_left: 1}; Var game_panel = {views: "form", id: "game_panel", lines: [{cols: [{template: '& lt; Span class = "main_title" & gt; Money: $ # sum # .00 & lt; / Span & gt; ', Data: {amount: game_data.amount}, align: "center"},}]};  

I have also tried to return it as a variable:

  template: function (game_data) {return '& lt; Span class = "main_title" & gt; Money: '+ game_data.amount +' .00  

How to obtain any idea?

The code you are using is correct. You can check the next work snippet

If you are planning to update this number dynamically, it would be better to use a slightly different syntax

  Id: "t1", Template: '& lt; Span class = "main_title" & gt; Money: $ # sum # .00 & lt; / Span & gt; ', data: game_data, align: "center"  

and update the number for, be sure to call the template. Refresh, as the template does not automatically track data changes

  game_data.amount + = 2; . $$ ("t1") refresh ();  


No comments:

Post a Comment