First time to create function to use in Custom template Body of List Page
On the Client Side → List Page → Client Script
$.views.converters(“statuscolor”, function(val) {
if(val == 1)return “info”;
else if(val == 2)return “danger”;
else return “success”;
});
And on the Custom Template Body I try to use the function as
{{statuscolor:2 }}
Thanks for your reply and sharing the link
I have gone through the code still unable to resolve
Where I have put the below code, in the client script or startup script or global code
$.views.converters({
statuscolor: function(value) {
return result;
}
});
how do i get the value in the custom template of list page.
I try as
{{statuscolor:success}}
${{statuscolor:success}}
Please kindly guide where I have made the mistake.
Thanks for helping in advance.
Blank page usually implies server side PHP error (not client side JavaScript error which you can check by F12 → Console), you better configure your php.ini to display all errors.