This is a migrated thread and some comments may be shown as answers.

Adding a Dropdown to a template column

1 Answer 51 Views
Templates
This is a migrated thread and some comments may be shown as answers.
Melinda
Top achievements
Rank 1
Melinda asked on 16 Jun 2015, 08:54 AM

I am trying to make the category field of a template, that when in edit mode turns into a dropdown box that lists all the available categories. Is there a simple way to do this?

 I would like to keep the dropdown hidden until the field is actually edited.

 

This is my current template: 

<script id="rowTemplate" type="text/x-kendo-template">
        <tr class="k-master-row" data-uid=#: uid #> 
            <td class="k-hierarchy-cell">
                <a href="\\#" class="k-icon k-plus" title="transaction details"></a>
            </td>
            <td>#= kendo.toString(transactionDate, 'MM/dd/yyyy') #</td>
            <td>#: description.description #</td>
            <td>#: category.categoryName #</td>
           <td>#: account.accountName #</td>
            <td class="currencyField">#=kendo.toString(amount.amount, 'c') #</td>
            <td class="tId">#: transactionBaseType #</td>
            <td>
              <a class="k-button k-button-icontext k-grid-edit" href="\#">
                <span class="k-icon k-edit"></span>Edit
              </a>
            </td>
        </tr>
    </script>

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 18 Jun 2015, 08:11 AM
Hello Melinda,

Are you using a grid? If yes, then you should use a custom editor or a foreignkey column in order to show a dropdownlist in edit mode.

Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Templates
Asked by
Melinda
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or