setting Grid Row items to DropdownList

4 posts, 0 answers
  1. Michael
    Michael avatar
    7 posts
    Member since:
    Apr 2014

    Posted 28 Jan 2015 Link to this post

    Hello There,

    I have two lists: 1) Grid  2) DropdownList.  I can add new row to the grid from the dropdownlist selection.  What I like to accomplish is to edit the dropdownlist, when the row is selected in the Grid.  I can see my selection but my code failed to update the dropdownlist.  Your help is greatly appreciated   

    Here are the codes

      
    onSelect : function(e) {
                    e.preventDefault();
                    var self = this;          
                    window.console && console.log("MVN what is self here:  "+self);
                    var kendoGrid = $("#facultySupportGrid").data("kendoGrid");
     
                    var selectedRow = kendoGrid.select();
                    var selected = kendoGrid.dataItem(selectedRow);
                    
                    if (selected !== null) {
                        self.set("addFacultySupportSectionVisible", true);              
                        self.set("selectedId", selected.id);
     
                        alert(selected.facultyFullName)
                        self.set("selectedFullName", selected.facultyFullName);       
                        // Hide button when fields are expanded
                        self.set("hideAddFacultyButton", false);
                    }
                },

    <h2>Add Faculty Information</h2>
                <label class="control-label">Name*:</label>
                <input id="newFacultyDropDown" name="newFacultyDropDown" data-role="dropdownlist"
                       data-option-label="- select faculty -"
                       data-auto-bind="true"
                       data-text-field="value"
                       data-value-field="key"
                       data-bind="value: selectedFullName,source: fundingFacultiesList" required validatemessage="Name is required" />
                <span class="k-invalid-msg" data-for="newFacultyDropDown"></span>
            </div>
            

  2. Michael
    Michael avatar
    7 posts
    Member since:
    Apr 2014

    Posted 29 Jan 2015 in reply to Michael Link to this post

    Sorry I forgot to include the grid 
    <div id="facultySupportGrid" data-role="grid"
             data-editable="false"
             data-selectable="true"
             data-scrollable="true"
             data-sortable="true"
             data-pageable="false"
             data-columns="[
                    { 'field': 'id'},
                    {title:'Name','field': 'facultyFullName','width': '250px'},
                    {title:'Role', 'field':'facultyRole'},
                    {title:'Action', 'width': '120px', template:kendo.template($('#facultySupport-deleteLink').html() ) }
     
             ]"
             data-bind="source: fdingParticipatingGridView,
                        events:{
                             change:onSelect,
                             dataBound: dataBoundFtySupport
                        }">
     
        </div>
  3. Kendo UI is VS 2017 Ready
  4. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 30 Jan 2015 Link to this post

    Hi Michael,

    Your configuration looks correct. I am not sure where exactly the problem comes from.
    Could you please confirm that the value of the selectedFullName field matches one of the "key" values from fundingFacultiesList?

    Regards,
    Alexander Valchev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  5. Michael
    Michael avatar
    7 posts
    Member since:
    Apr 2014

    Posted 02 Dec 2015 in reply to Alexander Valchev Link to this post

    Hi sorry this has been resolved 

    Thanks

Back to Top
Kendo UI is VS 2017 Ready