diff --git a/app/MyApp/app/collections/CourseCareerPath b/app/MyApp/app/collections/CourseCareerPath.js similarity index 86% rename from app/MyApp/app/collections/CourseCareerPath rename to app/MyApp/app/collections/CourseCareerPath.js index 23ddf3394..25663ab60 100644 --- a/app/MyApp/app/collections/CourseCareerPath +++ b/app/MyApp/app/collections/CourseCareerPath.js @@ -3,7 +3,7 @@ $(function() { App.Collections.CourseCareerPath = Backbone.Collection.extend({ url: function() { - if (this.CoursePathName != "" && this.MemberID != "") { + if (this.CoursePathName!= undefined && this.MemberID!= undefined ) { return App.Server + '/coursecareerpath/_design/bell/_view/GetCourseCareerByLevelNameMemberIds/?key=["' +this.CoursePathName + '","' +this.MemberID+ '"]&include_docs=true' } else { return App.Server + '/coursecareerpath/_all_docs?include_docs=true' @@ -21,9 +21,8 @@ $(function() { comparator: function(model) { var type = model.get('Type') if (type) return type.toLowerCase() - }, - - model: App.Models.CourseacreerPath + } }) }) + diff --git a/app/MyApp/app/views/AddCourseCareer.js b/app/MyApp/app/views/AddCourseCareer.js index 59a59019c..a60782017 100644 --- a/app/MyApp/app/views/AddCourseCareer.js +++ b/app/MyApp/app/views/AddCourseCareer.js @@ -51,6 +51,15 @@ $(function() { arrcourses.push(courseslist) arrCourseIds.push(courseId) } + var courseCareers = new App.Collections.CourseCareerPath() + courseCareers.memberId = $.cookie('Member._id'); + courseCareers.fetch({ + async:false + }); + this.vars.careerList = []; + for(var i = 0; i < (courseCareers.length -1 ); i++) { + this.vars.careerList.push(courseCareers.models[i].attributes); + } this.vars.Courselist = arrcourses this.vars.Courseid = arrCourseIds this.vars.Course_Length = this.collection.models.length-1 diff --git a/app/MyApp/index.html b/app/MyApp/index.html index b68499b1e..542e5a52a 100644 --- a/app/MyApp/index.html +++ b/app/MyApp/index.html @@ -1486,6 +1486,13 @@