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

Dynamically created combobox issues

0 Answers 92 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Devon asked on 13 Aug 2012, 12:24 PM
Hi everyone.

I have an issue with some comboboxes which I create dynamically inside a template for a listview.

I need to be able to get the value of the combobox when a button is clicked and use that value to update my datasource. My problem is that I cannot isolate the combobox in order to get the data.

Can someone please have a look at my code and give me some ideas??


<script type="text/x-kendo-template" id="packagesTemplate">       
        <h3 class="item-title">${Name}</h3>
        <p class="item-info">Status: ${Status}</p>                
        <select data-role="comboBox" id="select#:id#" >
        <option value="Pending">Pending</option>
        <option value="Delivered">Delivered</option>
        <option value="Damaged">Damaged</option>
        <option value="Refused">Refused</option>
        <a data-role="button" data-item-id="#:id#" data-click="saveChanges" class="details-link">Save Changes</a>

I have no problem getting the dataItem from the button click (var button = e.button). Is there no way to get the combobox in a similar fashion? (var combo = e.comboBox)? I have tried everything I can think of and nothing seems to be working.

Button Click: (This must get the combobox value/text)

function saveChanges(e) {
            var button = e.button,
                item = packageDataSource.get("itemId"));

No answers yet. Maybe you can help?

General Discussions
Asked by
Top achievements
Rank 1
Share this question