Commit 8af824a82e6eae5ed4c6de0ac738ec53b682932b

Authored by Amrita Vishnoi
2 parents 1051c30c bd77734a

Merge branch 'alftaeticAAListView' into Develop

400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
@@ -49,25 +49,29 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou @@ -49,25 +49,29 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
49 else 49 else
50 { 50 {
51 51
  52 +
52 $('#grid-view').css("display", "none"); 53 $('#grid-view').css("display", "none");
53 if ($scope.isListViewDataLoaded == true) { 54 if ($scope.isListViewDataLoaded == true) {
54 - var htm = '';  
55 - htm += "<table class='table table-hover table-fixed bg-white table-txt12'> <thead class='clsthead'><tr class='active'><th width='25%'>Title</th> <th width='15%'>Region</th> <th width='30%'>System</th><th width='15%'>View</th> <th width='15%'>Type</th></tr></thead><tbody class='clstbody'>";  
56 - $.ajax({  
57 - url: '~/../content/data/json/aa/aa_dat_contentlist.json',  
58 - dataType: "json",  
59 - success: function (result) {  
60 - $(result.root.Item).each(function (key, value) {  
61 - console.log(key + " " + value);  
62 - htm += "<tr id=" + value._Id + " onclick='openListViewModuleItem(event)' ondblclick='openModuleItemView(event)'>"  
63 - htm += '<td width="25%">' + value._Title + '</td><td width="15%">' + value._BodyRegion + '</td><td width="30%">' + value._BodySystem + '</td><td width="15%">' + value._ViewOrientation + '</td><td width="15%">' + value._ImageType + '</td>';  
64 - htm += "</tr>"  
65 - });  
66 - htm += "</tbody></table>";  
67 - $("#list-view").html(htm);  
68 - $compile(htm)($scope);  
69 - }  
70 - }); 55 + var promise = ModuleService.loadModuleDataBasedOnModuleName($scope.moduleName)
  56 + .then(
  57 + function (result) {
  58 + // alert(JSON.stringify($scope.moduleLandingData));
  59 + $scope.moduleLandingData = result;
  60 + $scope.selectedAAListViewData = new jinqJs()
  61 + .from($scope.moduleLandingData.data.root.Item)
  62 + .orderBy([{ field: '_Title', sort: 'asc' }])
  63 + .select();
  64 + var htm = '';
  65 + htm += "<table class='table table-hover table-fixed bg-white table-txt12'> <thead class='clsthead'><tr class='active'><th width='25%'>Title</th> <th width='15%'>Region</th> <th width='30%'>System</th><th width='15%'>View</th> <th width='15%'>Type</th></tr></thead><tbody class='clstbody'>";
  66 + angular.forEach($scope.selectedAAListViewData, function (value, key) {
  67 + htm += "<tr id=" + value._Id + " onclick='openListViewModuleItem(event)' ondblclick='openModuleItemView(event)'>"
  68 + htm += '<td width="25%">' + value._Title + '</td><td width="15%">' + value._BodyRegion + '</td><td width="30%">' + value._BodySystem + '</td><td width="15%">' + value._ViewOrientation + '</td><td width="15%">' + value._ImageType + '</td>';
  69 + htm += "</tr>"
  70 + });
  71 + htm += "</tbody></table>";
  72 + $("#list-view").html(htm);
  73 + $compile(htm)($scope);
  74 + });
71 $('#list-view').css("display", "block"); 75 $('#list-view').css("display", "block");
72 $scope.isListViewDataLoaded = false; 76 $scope.isListViewDataLoaded = false;
73 } 77 }