Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

conditional template versus function call

$
0
0

I have a column template set up to call a function like so:

 template: "<a onclick='Jump(${A}, \"${B}\");'>${C}</a>"

I want the cell to be empty (since I'm using a tooltip on the column as well and filtering out the empty cells), so I'm changing to a function call:

 template: "#= getGridJump(A,C,B) #"

 Where:

function getGridJump (A, C, B) {
    if (B=== null) {
        return ''
    } else {
        return '<a onclick="Jump(' + A+ ', "' + B + '");">' + C+ '</a>'
    }
}

I can see the correct values in the cell, but there's an additional space between the second argument that isn't there in the original template and the function does not fire. Am I missing some formatting on the return value?

Thanks.


Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>