Custom html/javascript in Sproutcore?

405 Views Asked by At

Is it possible to have custom html/javascript in Sproutcore?

I have to use some code from a cloud service provider.

1

There are 1 best solutions below

0
On BEST ANSWER

Yes, this is rather easy. In your view you can define a render() method:

App.myView = SC.View.extend({

  render: function(context, firstTime) {
    var someValue = `getValue`

    context.push(
      "<span class='mySpan'>", someValue, "</span>",
      "Any Other html/javascript that you want, can go here."
    );

  }

})

You can also use the firstTime property to know if you are rendering the first time (put out everything), or just updating the existing code.

You can find out more: