| <apex:page standardStylesheets="false" sidebar="false" showHeader="false" applyBodyTag="false" applyHtmlTag="false" docType="html-5.0" controller="smartTableAngularJSController"> |
| <html lang="en" ng-app="demoApp"> |
| <head> |
| <!-- <meta charset="utf-8"/>--> |
| <meta name="viewport" content="width=device-width, initial-scale=1"/> |
| <title>Angular Demo</title> |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"/> |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css"/> |
| |
| <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js"></script> |
| <script> |
| // define the app |
| var demoApp = angular.module('demoApp', []); |
| // add the controller |
| demoApp.controller('DemoCtrl', function ($scope) { |
| $scope.account = {!account} |
| $scope.cases= {!Cases} |
| $scope.sortType = 'CaseNumber'; // set the default sort type |
| $scope.sortReverse = false; // set the default sort order |
| $scope.query = ''; // set the default search/filter term |
| }); |
| |
| |
| </script> |
| </head> |
| <body class="container" ng-controller="DemoCtrl"> |
| <h1 style="color:Green">{{account.Name}}</h1> |
| <p class="lead" style="color:Gray"> |
| {{account.BillingStreet}}<br/> |
| {{account.BillingCity}}, {{account.BillingState}} |
| {{account.BillingPostalCode}} |
| </p> |
| <b>Search</b> <input ng-model="query" /><br/><br/> |
| |
|
|
| |
| <table class="table table-bordered"> |
| <tr> |
| <td> |
| <a href="#" ng-click="sortType = 'CaseNumber'; sortReverse = !sortReverse"> |
| CaseNumber |
| <span ng-show="sortType == 'CaseNumber' && !sortReverse" class="fa fa-caret-down"></span> |
| <span ng-show="sortType == 'CaseNumber' && sortReverse" class="fa fa-caret-up"></span> |
| </a> |
| </td> |
| <td> |
| <a href="#" ng-click="sortType = 'Subject'; sortReverse = !sortReverse"> |
| Subject |
| <span ng-show="sortType == 'Subject' && !sortReverse" class="fa fa-caret-down"></span> |
| <span ng-show="sortType == 'Subject' && sortReverse" class="fa fa-caret-up"></span> |
| </a> |
| </td> |
| <td> |
| <a href="#" ng-click="sortType = 'Status'; sortReverse = !sortReverse"> |
| Status |
| <span ng-show="sortType == 'Status' && !sortReverse" class="fa fa-caret-down"></span> |
| <span ng-show="sortType == 'Status' && sortReverse" class="fa fa-caret-up"></span> |
| </a> |
| </td> |
| </tr> |
| |
| <tr ng-repeat="case in cases|orderBy:sortType:sortReverse | filter:query "> |
| <td>{{case.CaseNumber}}</td> |
| <td>{{case.Subject}}</td> |
| <td>{{case.Status}}</td> |
| </tr> |
| </table> |
| </body> |
| </html> |
| </apex:page> |
No comments:
Post a Comment