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

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

5 Answers 536 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Lilan
Top achievements
Rank 2
Lilan asked on 11 Mar 2015, 10:03 AM
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?





5 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 13 Mar 2015, 07:56 AM

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!
 
0
Lilan
Top achievements
Rank 2
answered on 13 Mar 2015, 08:29 AM
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>

0
Kiril Nikolov
Telerik team
answered on 13 Mar 2015, 08:35 AM

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!
 
0
Clint
Top achievements
Rank 1
Iron
answered on 04 Oct 2016, 03:45 PM

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!!!

0
Dimiter Topalov
Telerik team
answered on 06 Oct 2016, 12:12 PM
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.
Tags
General Discussions
Asked by
Lilan
Top achievements
Rank 2
Answers by
Kiril Nikolov
Telerik team
Lilan
Top achievements
Rank 2
Clint
Top achievements
Rank 1
Iron
Dimiter Topalov
Telerik team
Share this question
or