Pregunta

Using JsViews is it possible to have a converter precede a helper function in a data-link property? Somehow like this..

<div data-link="{myConverter:~myFunction('param1'):}"></div>

Thanks!

¿Fue útil?

Solución

If you mean that you want the converter to convert the value of the param1 field of your data object, and then pass it to the myConverter function, then no. The converter will process the result of the expression ~myFunction(...).

But you can create an equivalent helper function to your converter, and then chain the helpers:

<div data-link="~myFunction(~myConvert(param1))></div>"

BTW this will be data linked so that it updates when the param1 field changes. - I'm not sure if you meant to put quotes around 'param1'. If 'param1' is a string literal you are passing in, then data-linking to it won't have any reason to update, so you could just write:

<div>{{:~myFunction(~myConvert('param1'))}}</div>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top