My grid was working fine when I did not use rowTemplate: The columns and command buttons were right where I wanted them.
When I switched using a rowTemplate the command buttons no longer appear.
- What markup needs to be in the template?
- If there is command markup, do I still need the command: property: in my fields: setting ?
$("#grid").kendoGrid({
dataSource: dataSource1,
rowTemplate: kendo.template($("#row-template").html().replace('k-alt', '')),
altRowTemplate: kendo.template($("#row-template").html()),
pageable: true,
height: 512,
toolbar: [
{ name:"create", text:"New Folder", id:"add"}],
columns: [
{ field: "name", title: "Name" },
{ field: "created", title: "Created", width: "12em" },
{ command: [ {name:"edit",text:"Rename"}, "destroy"], title:" ", width:"17em"} ],
editable: { mode:"popup" }
});
...html...
<script id="row-template" type="text/x-kendo-template">
<tr class='k-alt'>
<td>
<a class='viewlink' href='<?sas= &openURL?>'><img alt='Open ${name}' src='<?sas= &iconURL?>' >${name}</a>
</td>
<td>${created}</td>
<td>WHAT GOES HERE TO GET COMMAND BUTTONS ?</td>
</tr>
</script>
Thanks
When I switched using a rowTemplate the command buttons no longer appear.
- What markup needs to be in the template?
- If there is command markup, do I still need the command: property: in my fields: setting ?
$("#grid").kendoGrid({
dataSource: dataSource1,
rowTemplate: kendo.template($("#row-template").html().replace('k-alt', '')),
altRowTemplate: kendo.template($("#row-template").html()),
pageable: true,
height: 512,
toolbar: [
{ name:"create", text:"New Folder", id:"add"}],
columns: [
{ field: "name", title: "Name" },
{ field: "created", title: "Created", width: "12em" },
{ command: [ {name:"edit",text:"Rename"}, "destroy"], title:" ", width:"17em"} ],
editable: { mode:"popup" }
});
...html...
<script id="row-template" type="text/x-kendo-template">
<tr class='k-alt'>
<td>
<a class='viewlink' href='<?sas= &openURL?>'><img alt='Open ${name}' src='<?sas= &iconURL?>' >${name}</a>
</td>
<td>${created}</td>
<td>WHAT GOES HERE TO GET COMMAND BUTTONS ?</td>
</tr>
</script>
Thanks