Commit 896dee6f9baac61d4daacb042a99597bc95a837b

Authored by Amrita Vishnoi
1 parent f6a824ab

able to send multiple data to service

400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
@@ -9,19 +9,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, BodyRegions, Bod @@ -9,19 +9,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, BodyRegions, Bod
9 9
10 var moduleData = []; 10 var moduleData = [];
11 11
12 - $scope.AllBodyRegion = [];  
13 - $scope.AllBodySystem = [];  
14 - $scope.AllOrientation = []; 12 + $scope.AllBodyRegion = [];
  13 + $scope.AllBodySystem = [];
  14 + $scope.AllOrientation = [];
15 $scope.AllImageType = []; 15 $scope.AllImageType = [];
16 16
17 $scope.loadForModuleById = function (moduleId) { 17 $scope.loadForModuleById = function (moduleId) {
18 -  
19 - $scope.moduleId = moduleId;  
20 -  
21 - console.log('loadForModuleById is called')  
22 - var moduleName = Modules[moduleId].Name;  
23 -  
24 - $scope.loadDataForModule(moduleName); 18 +
  19 + $scope.moduleId = moduleId;
  20 +
  21 + console.log('loadForModuleById is called')
  22 + var moduleName = Modules[moduleId].Name;
  23 +
  24 + $scope.loadDataForModule(moduleName);
25 } 25 }
26 26
27 $scope.loadDataForModule = function (moduleName) 27 $scope.loadDataForModule = function (moduleName)
@@ -29,14 +29,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, BodyRegions, Bod @@ -29,14 +29,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, BodyRegions, Bod
29 29
30 //0. load filter static data 30 //0. load filter static data
31 31
32 - $scope.AllBodyRegion = BodyRegions;  
33 - $scope.AllBodySystem = BodySystems;  
34 - $scope.AllOrientation = ViewOrientations; 32 + $scope.AllBodyRegion = BodyRegions;
  33 + $scope.AllBodySystem = BodySystems;
  34 + $scope.AllOrientation = ViewOrientations;
35 $scope.AllImageType = ImageTypes; 35 $scope.AllImageType = ImageTypes;
36 36
37 //1. load dynamic data for module specific images 37 //1. load dynamic data for module specific images
38 var jsonPath; 38 var jsonPath;
39 - if(moduleName==ATLAS_ANATOMY) 39 + if(moduleName==ATLAS_ANATOMY)
40 { 40 {
41 jsonPath ='~/../content/data/json/aa/aa_dat_contentlist.json'; 41 jsonPath ='~/../content/data/json/aa/aa_dat_contentlist.json';
42 } 42 }
@@ -51,53 +51,54 @@ function ($scope, $rootScope, $compile, $http, $log, $location, BodyRegions, Bod @@ -51,53 +51,54 @@ function ($scope, $rootScope, $compile, $http, $log, $location, BodyRegions, Bod
51 jsonPath ='~/../content/data/json/ci/ci_dat_contentlist.json'; 51 jsonPath ='~/../content/data/json/ci/ci_dat_contentlist.json';
52 } 52 }
53 53
54 - var promise = DataService.getJson(jsonPath)  
55 - promise.then( 54 + var promise = DataService.getJson(jsonPath)
  55 + promise.then(
56 function (result) { 56 function (result) {
57 - $scope.AtlasAnatomyData = result;  
58 -  
59 - $scope.data = new jinqJs()  
60 - .from($scope.AtlasAnatomyData.root.Item)  
61 - .orderBy([{ field: '_Title', sort: 'asc' }])  
62 - .select();  
63 -  
64 - //console.log($scope.selectedCIListViewData);  
65 - //$('#grid-view').empty(); 57 + $scope.AtlasAnatomyData = result;
  58 +
  59 + $scope.data = new jinqJs()
  60 + .from($scope.AtlasAnatomyData.root.Item)
  61 + .orderBy([{ field: '_Title', sort: 'asc' }])
  62 + .select();
  63 +
  64 + //console.log($scope.selectedCIListViewData);
  65 + //$('#grid-view').empty();
66 angular.forEach($scope.data, function (value, key) 66 angular.forEach($scope.data, function (value, key)
67 { 67 {
68 - var obj = {};  
69 - obj.moduleId = value._Id;  
70 - //moduleData.push(value._Id);  
71 -  
72 - $scope.ImageName = value._TileImageName;  
73 - $scope.imagePath = "~/../content/images/aa/thumbnails/" + value._TileImageName;  
74 - $scope.TileViewId = value._Id;  
75 -  
76 - var $el = $('<div id="' + value._Id + '" class="col-sm-3 col-md-3" title = "' + value._Title + '" data-ng-click="openModuleItem($event.data.value=' + value._Id + ')">'  
77 - + '<div class="thumbnail" >'  
78 - + '<img class="tinyImg" id="' + value._Title + '"ng-src="' + $scope.imagePath + '" alt="" title="" >'  
79 - + '<div class="caption"><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view');  
80 -  
81 -  
82 - $compile($el)($scope);  
83 - 68 + var moduleData = [];
  69 + moduleData.push(value._Id);
  70 + moduleData.push(value._TileImageName);
  71 + //moduleData.push("~/../content/images/aa/thumbnails/" + value._TileImageName);
  72 +
  73 + $scope.ImageName = value._TileImageName;
  74 + $scope.imagePath = "~/../content/images/aa/thumbnails/" + value._TileImageName;
  75 + $scope.TileViewId = value._Id;
  76 +
  77 + var $el = $('<div id="' + value._Id + '" class="col-sm-3 col-md-3" title = "' + value._Title + '" data-ng-click="openModuleItem($event.data.value=' + moduleData + ')">'
  78 + + '<div class="thumbnail" >'
  79 + + '<img class="tinyImg" id="' + value._Title + '"ng-src="' + $scope.imagePath + '" alt="" title="" >'
  80 + + '<div class="caption"><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view');
  81 +
  82 +
  83 + $compile($el)($scope);
  84 +
84 //$(".sidebar").mCustomScrollbar({ 85 //$(".sidebar").mCustomScrollbar({
85 - // autoHideScrollbar: true,  
86 - // //theme:"rounded" 86 + // autoHideScrollbar: true,
  87 + // //theme:"rounded"
87 //}); 88 //});
88 -  
89 - 89 +
  90 +
90 }); 91 });
91 92
92 $scope.scroll(); 93 $scope.scroll();
93 -  
94 - },  
95 - function (error) {  
96 - // handle errors here 94 +
  95 + },
  96 + function (error) {
  97 + // handle errors here
97 console.log(' $scope.IllustrationData = ' + error.statusText); 98 console.log(' $scope.IllustrationData = ' + error.statusText);
98 - } 99 + }
99 ); 100 );
100 - 101 +
101 102
102 } 103 }
103 104
@@ -107,13 +108,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, BodyRegions, Bod @@ -107,13 +108,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, BodyRegions, Bod
107 108
108 $scope.openModuleItem = function (moduleDataDetail) { 109 $scope.openModuleItem = function (moduleDataDetail) {
109 110
110 - alert('call on TileViewListController');  
111 -  
112 - var moduleDetails = [];  
113 - moduleDetails.push(event.moduleId);  
114 - moduleDetails.push($scope.imageName);  
115 - moduleDetails.push($scope.imagePath);  
116 - moduleDetails.push($scope.iileViewId); 111 + alert('call on TileViewListController');
117 112
118 ModuleService.SaveOpenedModules(moduleDetails); 113 ModuleService.SaveOpenedModules(moduleDetails);
119 114