kendo-drop-down-list ng-change fires twice

6 posts, 0 answers
  1. Lilan
    Lilan avatar
    55 posts
    Member since:
    Feb 2015

    Posted 11 Mar 2015 Link to this post

    Hi, 

    I can't figure it out why kendo-drop-down-list ng-change fired twice as configuration done as follows, 

    //HTML
    <select kendo-drop-down-list
    ng-model="EditPriestSetting.settingYear"
    k-data-text-field="'keyDate'"
    k-data-value-field="'valueDate'"
    k-data-source="addYears"
    ng-change="GetEditPriestSettings(EditPriestSetting.settingYear)">
    </select>

    //script 
    $scope.GetEditPriestSettings=function(selectedYear){
    console.log($scope.EditPriestSettings);
    if(selectedYear) {

    angular.forEach($scope.EditPriestSettings, function (PriestSetting) {
    if (parseInt(selectedYear) === parseInt(PriestSetting.Year)) {
    $scope.EditPriestSetting = {
    settingYear: PriestSetting.Year,
    holiday: PriestSetting.HolidayDays,
    seniorDays: PriestSetting.SeniorDays,
    studyLeave: PriestSetting.StudyLeaveDays,
    freeDays: PriestSetting.FreeDays,
    redDays: PriestSetting.RedDays,
    comment: PriestSetting.Comment

    };

    };
    });

    }
    };

    what am i missing here?





  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 13 Mar 2015 Link to this post

    Hello Lilan,

    We recommend the use of k-ng-model instead of ng-model as it is optimized for Kendo UI Widgets, furthermore you need to use the Kendo UI DropDownList events listed in our documentation (also has change event), as the ng-change required ng-model.

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Lilan
    Lilan avatar
    55 posts
    Member since:
    Feb 2015

    Posted 13 Mar 2015 Link to this post

    Hi Kiril, 

    It looks still same as configured below 

    <select kendo-drop-down-list
    k-ng-model="EditPriestSetting.settingYear"
    k-data-text-field="'keyDate'"
    k-data-value-field="'valueDate'"
    k-data-source="addYears"
    k-on-change="GetEditPriestSettings(EditPriestSetting.settingYear)">
    </select>

  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 13 Mar 2015 Link to this post

    Hello Lilan,

    Please check the following sample that shows the DropDownList change event, being fired only once:

    http://dojo.telerik.com/emUXo

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Clint
    Clint avatar
    4 posts
    Member since:
    Apr 2016

    Posted 04 Oct in reply to Kiril Nikolov Link to this post

    Do you have an example that uses Angular?

    I'm sick to death trying to translate from jQuery to Angular!!!

    Can you PLEASE start providing more Angular support!!!

  7. Dimiter Topalov
    Admin
    Dimiter Topalov avatar
    349 posts

    Posted 06 Oct Link to this post

    Hello Clint,

    I am afraid I do not understand how are these comments related to the topic, as the example, provided by my colleague uses AngularJS.

    Can you please be more specific exactly what AngularJS and Kendo UI-related issue you need assistance with (open a new thread if it is not closely related to the topic, discussed in this one), and we will be glad to help.

    Thank you in advance.

    Regards,
    Dimiter Topalov
    Telerik by Progress
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Back to Top
Kendo UI is VS 2017 Ready