Sortierung vollstaendig implementiert
This commit is contained in:
parent
5016e27cca
commit
d99534a37a
@ -31,7 +31,7 @@
|
|||||||
<md-list>
|
<md-list>
|
||||||
<!--Below code it will disable animation to better performance-->
|
<!--Below code it will disable animation to better performance-->
|
||||||
<div ng-if="!isAnimated" class="row pokemon-list-item md-list-item-default"
|
<div ng-if="!isAnimated" class="row pokemon-list-item md-list-item-default"
|
||||||
ng-repeat="pokemon in pokemons | filter: filterText | orderBy: 'pokemonname' | limitTo: numberOfItemsToDisplay">
|
ng-repeat="pokemon in pokemons | filter: filterText | orderBy:propertyName:reverse | limitTo: numberOfItemsToDisplay">
|
||||||
<div class="col-25 icon-user">
|
<div class="col-25 icon-user">
|
||||||
<img ng-src="{{ pokemon.pokemonimage }}" class="image-list-thumb"/>
|
<img ng-src="{{ pokemon.pokemonimage }}" class="image-list-thumb"/>
|
||||||
|
|
||||||
|
|||||||
@ -17,30 +17,22 @@
|
|||||||
<!--list section-->
|
<!--list section-->
|
||||||
<md-list>
|
<md-list>
|
||||||
<md-list-item class="md-list-item-default" ng-click="orderby('asc')">
|
<md-list-item class="md-list-item-default" ng-click="orderby('asc')">
|
||||||
<i class="fa fa-play"></i>
|
<i class="fa fa-sort-alpha-asc"></i><p>Sortierung aufsteigend</p>
|
||||||
<p>Sortierung aufsteigend</p>
|
|
||||||
</md-list-item>
|
</md-list-item>
|
||||||
|
|
||||||
<md-list-item class="md-list-item-default" ng-click="orderby('desc')">
|
<md-list-item class="md-list-item-default" ng-click="orderby('desc')">
|
||||||
<i class="fa fa-stop"></i>
|
<i class="fa fa-sort-alpha-desc"></i><p>Sortierung absteigend</p>
|
||||||
<p>Sortierung absteigend</p>
|
|
||||||
</md-list-item>
|
</md-list-item>
|
||||||
|
|
||||||
<md-list-item class="md-list-item-default" ng-click="sortby('pokedexid')">
|
<md-list-item class="md-list-item-default" ng-click="sortby('pokedexid')">
|
||||||
<i class="ion-android-delete"></i>
|
<i class="fa fa-tag"></i><p>Nach PokedexID sortieren</p>
|
||||||
<p>Nach PokedexID sortieren</p>
|
|
||||||
</md-list-item>
|
</md-list-item>
|
||||||
<md-list-item class="md-list-item-default" ng-click="sortby('pokemonname')">
|
<md-list-item class="md-list-item-default" ng-click="sortby('pokemonname')">
|
||||||
<i class="ion-android-delete"></i>
|
<i class="fa fa-paw"></i><p>Nach Namen sortieren</p>
|
||||||
<p>Nach Namen sortieren</p>
|
|
||||||
</md-list-item>
|
</md-list-item>
|
||||||
<md-list-item class="md-list-item-default" ng-click="sortby('pokemontyp')">
|
<md-list-item class="md-list-item-default" ng-click="sortby('pokemontyp')">
|
||||||
<i class="ion-android-delete"></i>
|
<i class="fa fa-tags"></i><p>Nach Typ sortieren</p>
|
||||||
<p>Nach Typ sortieren</p>
|
|
||||||
</md-list-item>
|
</md-list-item>
|
||||||
<md-list-item class="md-list-item-default" ng-click="refreshData()">
|
<md-list-item class="md-list-item-default" ng-click="refreshData()">
|
||||||
<i class="ion-android-refresh"></i>
|
<i class="ion-android-refresh"></i><p>Liste aktualisieren</p>
|
||||||
<p>Liste aktualisieren</p>
|
|
||||||
</md-list-item>
|
</md-list-item>
|
||||||
</md-list><!--end list section-->
|
</md-list><!--end list section-->
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
// http://ngcordova.com/docs/plugins/sqlite/
|
// http://ngcordova.com/docs/plugins/sqlite/
|
||||||
//
|
//
|
||||||
// Controller of Pokemon List Page.
|
// Controller of Pokemon List Page.
|
||||||
appControllers.controller('pokemonListCtrl', function ($scope, $stateParams,$ionicScrollDelegate, $filter, $mdDialog, $timeout, $ionicModal, $state, $mdBottomSheet, $ionicHistory,pokedexDB, dataShare) {
|
appControllers.controller('pokemonListCtrl', function ($scope, $stateParams,$ionicScrollDelegate, $filter, $mdDialog, $timeout, $ionicModal, $state, $mdBottomSheet, $ionicHistory, pokedexDB, dataShare) {
|
||||||
|
|
||||||
// initialForm is the first activity in the controller.
|
// initialForm is the first activity in the controller.
|
||||||
// It will initial all variable data and let the function works when page load.
|
// It will initial all variable data and let the function works when page load.
|
||||||
@ -50,8 +50,14 @@ appControllers.controller('pokemonListCtrl', function ($scope, $stateParams,$ion
|
|||||||
jQuery('#pokemon-list-loading-progress').hide();
|
jQuery('#pokemon-list-loading-progress').hide();
|
||||||
jQuery('#pokemon-list-content').fadeIn();
|
jQuery('#pokemon-list-content').fadeIn();
|
||||||
$scope.isLoading = false;
|
$scope.isLoading = false;
|
||||||
|
|
||||||
|
//Standard orderby filter
|
||||||
|
$scope.propertyName = 'pokemonname';
|
||||||
|
$scope.reverse = true;
|
||||||
|
|
||||||
}, 1000);// End loading progress.
|
}, 1000);// End loading progress.
|
||||||
|
|
||||||
|
|
||||||
$scope.admob_key = window.globalVariable.adMob;
|
$scope.admob_key = window.globalVariable.adMob;
|
||||||
|
|
||||||
// Calling to initial AdMob.
|
// Calling to initial AdMob.
|
||||||
@ -112,15 +118,15 @@ appControllers.controller('pokemonListCtrl', function ($scope, $stateParams,$ion
|
|||||||
if (data.command=='sortby'){
|
if (data.command=='sortby'){
|
||||||
|
|
||||||
if (data.direction=='pokemonname'){
|
if (data.direction=='pokemonname'){
|
||||||
$scope.pokemons = $filter('orderBy')($scope.pokemons, 'pokemonname');
|
$scope.propertyName = 'pokemonname';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.direction=='pokedexid'){
|
if (data.direction=='pokedexid'){
|
||||||
$scope.pokemons = $filter('orderBy')($scope.pokemons, 'pokedexid');
|
$scope.propertyName = 'pokedexid';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.direction=='pokemontyp'){
|
if (data.direction=='pokemontyp'){
|
||||||
$scope.pokemons = $filter('orderBy')($scope.pokemons, 'pokemontypa');
|
$scope.propertyName = 'pokemontypa';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -128,7 +134,10 @@ appControllers.controller('pokemonListCtrl', function ($scope, $stateParams,$ion
|
|||||||
if (data.command=='orderby'){
|
if (data.command=='orderby'){
|
||||||
|
|
||||||
if (data.direction=='asc'){
|
if (data.direction=='asc'){
|
||||||
|
$scope.reverse = false;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$scope.reverse = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user