Hi,
I’am currently testing Kendo UI Grid. Our product uses Telerik and would like to move towards Kendo. I have a general question on the Grid control using Row templates.
Let say I use the following row template that I would like to use with a Grid. The first cell would be bound to the “Field1” of my object. The second cell is a link that points to a URL bound to “Field2” of my object.
<script id="MyRowTemplate" type="text/x-kendo-tmpl">
<tr>
<td>${ Field1 }</td>
<td><a href=”${Field2}”>click me</a></td>
</tr>
</script>
My question is the following. How would I insert some logic to remove the link if the “Field2” my object set is empty.
In pseudo code I would like to achieve the following.
If myObject.Field2 = “” then
Do not generate a link
Else
Show the link with the Url pointing to MyObject.Field2
In other words I’am trying to find a way to have more control on the html generated when binding fields to a grid. Not sure if using a Row template is the way to go in my case.
Thanks in advance.
I’am currently testing Kendo UI Grid. Our product uses Telerik and would like to move towards Kendo. I have a general question on the Grid control using Row templates.
Let say I use the following row template that I would like to use with a Grid. The first cell would be bound to the “Field1” of my object. The second cell is a link that points to a URL bound to “Field2” of my object.
<script id="MyRowTemplate" type="text/x-kendo-tmpl">
<tr>
<td>${ Field1 }</td>
<td><a href=”${Field2}”>click me</a></td>
</tr>
</script>
My question is the following. How would I insert some logic to remove the link if the “Field2” my object set is empty.
In pseudo code I would like to achieve the following.
If myObject.Field2 = “” then
Do not generate a link
Else
Show the link with the Url pointing to MyObject.Field2
In other words I’am trying to find a way to have more control on the html generated when binding fields to a grid. Not sure if using a Row template is the way to go in my case.
Thanks in advance.