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

Custom Editor of Grid does not work as expected

1 Answer 98 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Software
Top achievements
Rank 1
Software asked on 15 Dec 2017, 12:48 AM

Hi People, I am using grids popup editor to edit the grid row. in that I am using custom editor (DropDown control) for some of field of Grid. Following is code for that Dropdown editor: 
function prontoStratumDropDownEditor(container, options) {
              $('<input required data-text-field="ABC" data-value-field="XYZ" name="' + options.field + '"/>')
                .appendTo(container)
                .kendoDropDownList({
                     dataSource: new kendo.data.DataSource({
                        transport: {
                            read: {
                                url: "SomeURL",
                                type: "get",
                                datatype: "json",
                            }
                        }
                     }),
                     filter: "startswith",
                     suggest: true,
                     }
                });
        }

 

When I click on Edit Command of Grid, ideally dropdown should show me the name of already existing field For Eg: if grid row contain value "Animal" then when I click on Edit, by default DropDown should have "Animal" selected, but its not. I tried many things like getting rid of name property, remove required attribute etc but I do not know Why it is not showing me can anyone please help? 

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 18 Dec 2017, 12:09 PM
Hello,

Thank you for the provided code. Based on it I can assume that the issue occurs because the dataTextField and the dataValueField of the DropDown are not set:

https://docs.telerik.com/kendo-ui/api/javascript/ui/dropdownlist#configuration-dataTextField

https://docs.telerik.com/kendo-ui/api/javascript/ui/dropdownlist#configuration-dataValueField

After setting them the scenario is working as expected:

http://dojo.telerik.com/eyoGu

I hope this is helpful.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Software
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or