Custom Editor of Grid does not work as expected

2 posts, 0 answers
  1. Software
    Software avatar
    11 posts
    Member since:
    Mar 2017

    Posted 14 Dec 2017 Link to this post

    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? 

  2. Stefan
    Admin
    Stefan avatar
    2491 posts

    Posted 18 Dec 2017 Link to this post

    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.
Back to Top