Vorbereitung orderby sortby
This commit is contained in:
@@ -133,7 +133,7 @@ appControllers.controller('imageDownloadCtrl', function ($scope, $stateParams, $
|
||||
};
|
||||
|
||||
$scope.refreshData=function(){
|
||||
var data='refresh';
|
||||
var data={command:'refresh', direction: ''};
|
||||
dataShare.sendData(data);
|
||||
$scope.navigateTo('app.pokemonlist', {isAnimated:false});
|
||||
};
|
||||
|
||||
@@ -16,39 +16,32 @@
|
||||
<ion-content scroll="false">
|
||||
<!--list section-->
|
||||
<md-list>
|
||||
<md-subheader class="md-warn">The setting will change SQLite data</md-subheader>
|
||||
|
||||
<md-list-item class="md-list-item-default" ng-click="navigateTo('app.contractlist',true)">
|
||||
<md-list-item class="md-list-item-default" ng-click="orderby('asc')">
|
||||
<i class="fa fa-play"></i>
|
||||
|
||||
<p>Enable Row Animation</p>
|
||||
<p>Sortierung aufsteigend</p>
|
||||
</md-list-item>
|
||||
|
||||
<md-list-item class="md-list-item-default" ng-click="navigateTo('app.contractlist',false)">
|
||||
<md-list-item class="md-list-item-default" ng-click="orderby('desc')">
|
||||
<i class="fa fa-stop"></i>
|
||||
|
||||
<p>Disable Row Animation</p>
|
||||
<p>Sortierung absteigend</p>
|
||||
</md-list-item>
|
||||
|
||||
<md-list-item class="md-list-item-default" ng-click="clearAllData($event)">
|
||||
<md-list-item class="md-list-item-default" ng-click="sortby('pokedexid')">
|
||||
<i class="ion-android-delete"></i>
|
||||
|
||||
<p> Clear All Data</p>
|
||||
<p>Nach PokedexID sortieren</p>
|
||||
</md-list-item>
|
||||
<md-list-item class="md-list-item-default" ng-click="sortby('pokemonname')">
|
||||
<i class="ion-android-delete"></i>
|
||||
<p>Nach Namen sortieren</p>
|
||||
</md-list-item>
|
||||
<md-list-item class="md-list-item-default" ng-click="sortby('pokemontyp')">
|
||||
<i class="ion-android-delete"></i>
|
||||
<p>Nach Typ sortieren</p>
|
||||
</md-list-item>
|
||||
<md-list-item class="md-list-item-default" ng-click="refreshData()">
|
||||
<i class="ion-android-refresh"></i>
|
||||
|
||||
<p>Refresh Data</p>
|
||||
<p>Liste aktualisieren</p>
|
||||
</md-list-item>
|
||||
<md-list-item class="md-list-item-default">
|
||||
<i class="fa fa-user"></i>
|
||||
|
||||
<p>Contract Count</p>
|
||||
<span ng-show="loading">...</span>
|
||||
<span ng-show="!loading">{{contractsCount.length}}</span>
|
||||
|
||||
</md-list-item>
|
||||
|
||||
</md-list><!--end list section-->
|
||||
</ion-content>
|
||||
</ion-view>
|
||||
@@ -103,10 +103,36 @@ appControllers.controller('pokemonListCtrl', function ($scope, $stateParams,$ion
|
||||
|
||||
$scope.$on('data_shared',function(){
|
||||
var data = dataShare.getData();
|
||||
if (data=='refresh'){
|
||||
|
||||
if (data.command=='refresh'){
|
||||
$scope.initialForm();
|
||||
console.log('refresched');
|
||||
}
|
||||
|
||||
if (data.command=='sortby'){
|
||||
|
||||
if (data.direction=='pokemonname'){
|
||||
$scope.pokemons = $filter('orderBy')($scope.pokemons, 'pokemonname');
|
||||
}
|
||||
|
||||
if (data.direction=='pokedexid'){
|
||||
$scope.pokemons = $filter('orderBy')($scope.pokemons, 'pokedexid');
|
||||
}
|
||||
|
||||
if (data.direction=='pokemontyp'){
|
||||
$scope.pokemons = $filter('orderBy')($scope.pokemons, 'pokemontypa');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (data.command=='orderby'){
|
||||
|
||||
if (data.direction=='asc'){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// initAdMob for initial AdMob
|
||||
@@ -390,8 +416,21 @@ appControllers.controller('pokemonSettingCtrl', function ($scope,$ionicViewSwitc
|
||||
|
||||
};// End clear all data from sqlite
|
||||
|
||||
$scope.orderby=function(orderby){
|
||||
var data={command:'orderby', direction: orderby};
|
||||
dataShare.sendData(data);
|
||||
$scope.navigateTo('app.pokemonlist', {isAnimated:false});
|
||||
};
|
||||
|
||||
|
||||
$scope.sortby=function(sortby){
|
||||
var data={command:'sortby', direction: sortby};
|
||||
dataShare.sendData(data);
|
||||
$scope.navigateTo('app.pokemonlist', {isAnimated:false});
|
||||
};
|
||||
|
||||
$scope.refreshData=function(){
|
||||
var data='refresh';
|
||||
var data={command:'refresh', direction: ''};
|
||||
dataShare.sendData(data);
|
||||
$scope.navigateTo('app.pokemonlist', {isAnimated:false});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user