HTML template not taking script tag

I am getting error when I use script tag within template for datatable column. Is there an alternative

Hello,

Template declared as a string is not intended for adding <script> tags.
As a feature, it is designed to set the rendering pattern only.

However, if you need to use some custom methods in the template, the best way is to declare it as a function.

Such function recives two parameters

  • obj each data item
  • common common elements declared in type.

For datatable/treetable, ther are also three additional params:

  • value the value of the current cell
  • col the column config
  • ind the index of the current data item

Note that such function still has to return a string with text/valid html.


As another option, you can declare a custom methods in the component’s type so that they will be available

  • in a string template as {common.feature_name()}
  • in function temlpate as common.feature_name(obj, common)

Note that datatable/treetable have several built-in elements.

Thanks for the solution, my question got answered