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

First item always selected in custom dropdown editor

2 Answers 120 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Wayne Hiller
Top achievements
Rank 1
Veteran
Iron
Wayne Hiller asked on 31 Mar 2015, 04:53 PM
I have a custom dropdown editor in a inline editing grid. Note in the attached screen shot that the first item in the dropdown is always selected as well as the actual selection.

        var expGrid = $("#Expenses").createKendoGrid({
            stateKey: "PartEditExpenses",
            toolbar: kendo.template($("#expenses-toolbar-template").html()),
            columns: [
                { field: "TypeName", title: "Type", width: 200, footerTemplate: "Total", editor: function(container) {
                    $('<input required data-bind="source: expensetypes, value: TypeID"/>')
                        .appendTo(container)
                        .kendoDropDownList({
                            dataTextField: "Text",
                            dataValueField: "Value",
                            valuePrimitive: true,
                            select: function(e) {
                                expGrid.dataItem(expGrid.current().closest("tr")).TypeName = e.item.text();
                            }

                        });
                    } },
                    { field: "Amount", width: 100, format: "{0:n2}",
                                    footerTemplate: "<span id='totalExpenses'>#= abs.parts.edit.totalExpenses() #</span>" },
                    { field: "Source", width: 200 },
                    { field: "Description", width: 300 },
                    { field: "Averaged", title: "Avg", width: 50 },
                    { command: [{
                        name: "del",
                        text: "Delete",
                        click: function (e) {
                            var tr = $(e.target).closest("tr");
                            var data = this.dataItem(tr);
                            if (confirm("Deleted this Expense!")) {
                                data.set("IsDeleted", true);
                                me.updateTotalExpenses();
                            }
                        }
                    }]
                }
            ],
....





2 Answers, 1 is accepted

Sort by
0
Wayne Hiller
Top achievements
Rank 1
Veteran
Iron
answered on 31 Mar 2015, 04:58 PM
Opps I attached the wrong screen shot, here is the correct one.
0
Boyan Dimitrov
Telerik team
answered on 02 Apr 2015, 01:18 PM

Hello Wayne,

This issue should already been fixed in the latest internal builds. Please upgrade and let us know if the problem persists.

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Wayne Hiller
Top achievements
Rank 1
Veteran
Iron
Answers by
Wayne Hiller
Top achievements
Rank 1
Veteran
Iron
Boyan Dimitrov
Telerik team
Share this question
or