Hi,
Exist way to use dynamically function names in templates ?
I want to render some columns with image - it’s very simple red/green/yellow gifs, inform about situation.
I tried that :
grid.columns[ c ].template = function( obj )
{
let ci = 'mat_wrtoff' // mine column id at this moment
let val = obj[ ci ]
let clr = 'green'
if ( val == 'N' )
clr = 'red'
if ( val == 'G' )
clr = 'yellow'
return '<img src="imgs/' + clr + '.gif"/>'
}
It’s working . But I wanna to do like something that :
grid.columns[ c ].template = function( obj )
{
return window[ mineFunctionName ]( obj )
}
Sorry, but that isn’t working …
Maybe exist another solution for that, but I didn’t found info …
In the outside function the same as in first template source …
Thanks in advance…