sommen parseInt, groepen filteren op schooljaar

This commit is contained in:
2026-02-05 18:52:58 +01:00
parent e265e257b8
commit 48f3a9a7ff
5 changed files with 114 additions and 97 deletions
+20 -26
View File
@@ -6,12 +6,12 @@ $(function(){
this.id = p.id;
this.naam = p.naam
this.niveau = p.niveau;
this.totaantal = ko.observable(p.totaantal);
this.aantal2 = ko.observable(p.totaantal);
this.som1 = ko.observable(p.som1);
this.som2 = ko.observable(p.som2);
this.som3 = ko.observable(p.som3);
this.som4 = ko.observable(p.som4);
this.totaantal = ko.observable(parseInt(p.totaantal, 10)|| 0);
this.aantal2 = ko.observable(parseInt(p.totaantal, 10) || 0);
this.som1 = ko.observable(parseInt(p.som1, 10)|| 0);
this.som2 = ko.observable(parseInt(p.som2, 10)|| 0);
this.som3 = ko.observable(parseInt(p.som3, 10)|| 0);
this.som4 = ko.observable(parseInt(p.som4, 10)|| 0);
this.leerkrachten = ko.observableArray([]);
var dit = this;
if (p.leerkrachten){
@@ -335,14 +335,15 @@ $(function(){
}
});
}) // delete groepxuser
self.selectedGroep().totaantal(self.editGroep().totaantal());
self.selectedGroep().totaantal(parseInt(self.editGroep().totaantal(), 10));
// hier alle regels en/of aantallen opslaan
self.selectedGroep().som1(self.selectedGroep().totaantal());
self.selectedGroep().som2(0);
self.selectedGroep().som3(0);
self.selectedGroep().som4(0);
self.selectedGroep().som1(parseInt(self.editGroep().basis(), 10) || 0);
self.selectedGroep().som2(parseInt(self.editGroep().totplus(), 10) || 0);
self.selectedGroep().som3(parseInt(self.editGroep().totextra(), 10) || 0);
self.selectedGroep().som4(parseInt(self.editGroep().totextraplus(), 10) || 0);
if (self.editGroep().ondersteuningsvormen()){
$.each(self.editGroep().ondersteuningsvormen(), function(i,p){
@@ -360,18 +361,8 @@ $(function(){
if (p.id == null || p.id == 0) p.id = result;
}
},'json');
// HIER NOG OPTELLEN VAN LEERLINGEN PER ONDERSTEUNINGSVORM VOOR SELECTED GROEP
if (p.aantal()) {
self.selectedGroep().som1(self.selectedGroep().som1() - parseInt(p.aantal()));
switch (p.nivo){
case '2': self.selectedGroep().som2( self.selectedGroep().som2() + parseInt(p.aantal()));
break;
case '3': self.selectedGroep().som3( self.selectedGroep().som3() + parseInt(p.aantal()));
break;
case '4': self.selectedGroep().som4(self.selectedGroep().som4() + parseInt(p.aantal()));
break;
}
} ; // if p.aantal
}); // each
}// if
@@ -547,7 +538,7 @@ $(function(){
var dit = this;
let waarschuwing ="Weet u zeker dat u " + dit.naam() + " wilt archiveren?";
if(dit.aantal() > 0) waarschuwing = waarschuwing + "<br/>De leerlingen in deze groep die toegewezen zijn aan deze" +
if(parseInt(dit.aantal()) > 0) waarschuwing = waarschuwing + "<br/>De leerlingen in deze groep die toegewezen zijn aan deze" +
" ondersteuningsvorm worden ingedeeld in de basisondersteuning."
let sd ={
@@ -591,9 +582,12 @@ $(function(){
var self = ls.GroepenModel;
var dit = this;
let waarschuwing ="Weet u zeker dat u " + dit.naam() + " wilt verwijderen?";
if(dit.aantal > 0) "</br/> De leerlingen die toegewezen zijn aan deze ondersteuningsvorm worden ingedeeld in de basisondersteuning.";
apprise(waarschuwing, {verify: true, textYes: 'ja', textNo:'nee'}, function(ans){
if(parseInt(dit.aantal(), 10) > 0)waarschuwing = waarschuwing + "</br/> De leerlingen die toegewezen zijn aan deze ondersteuningsvorm worden ingedeeld in de basisondersteuning.";
console.log(dit, 'dit')
console.log(waarschuwing, 'waarschuwing')
apprise(waarschuwing, {verify: true, textYes: 'ja', textNo:'nee'}, function(ans){
if (ans){
$.post("index.php/monpas/groepen/deleteOS/" + dit.id, function(){
self.editGroep().ondersteuningsvormen.remove(dit);