From 472c5738c0d410a390fededc50c57ccb59591d62 Mon Sep 17 00:00:00 2001 From: Rupesh Manandhar Date: Mon, 5 Jun 2017 15:57:35 +0545 Subject: [PATCH] [#840]:list of courseCareer --- .../{CourseCareerPath => CourseCareerPath.js} | 7 +++---- app/MyApp/app/views/AddCourseCareer.js | 9 +++++++++ app/MyApp/index.html | 7 +++++++ 3 files changed, 19 insertions(+), 4 deletions(-) rename app/MyApp/app/collections/{CourseCareerPath => CourseCareerPath.js} (86%) 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 @@

<%= languageDict.attributes.New_Career_Path %>

Course Career Courses List Action + <% for (var i=0; i < careerList.length; i++){%> + + <%= careerList[i].CoursePathName %>Courses + <%= careerList[i].Courses %> + + + <% } %>