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