Angular.j.でページネーションを使用しているときに同じページに戻る必要があります。シナリオ。Angular.jsページネーションを使用しているときにキャンセルボタンをクリックしても同じページに戻ることはできません
<div class="row" ng-show="showForm">
<form name="billdata" id="billdata" enctype="multipart/form-data" novalidate>
<div class="input-group bmargindiv1 col-md-12">
<span class="input-group-addon ndrftextwidth text-right oditek-form" style="width:180px">Restaurant Name :</span>
<input type="text" name="colgname1" id="colgname1" class="form-control oditek-form" placeholder="Add Name" ng-model="name" ng-keypress="clearField('colgname1');" maxlength="50">
</div>
<input type="button" class="btn btn-red" ng-click="clearCustomerInfoData();" id="addProfileData" ng-value="ClearbuttonName" ng-show="showCancel"/>
</form>
</div>
<table class="table table-bordered table-striped table-hover" id="dataTable" >
<thead>
<tr>
<th>Edit</th>
<th>Remove</th>
</tr>
</thead>
<tbody id="detailsstockid">
<tr dir-paginate="cus in ($parent.labelResults=(listOfCustomerData | filter:searchProduct.rest_name | orderBy:'rest_name')) | itemsPerPage:5 track by $index" current-page="currentPage">
<td >
<a ui-sref="dashboard.customer.view">
<input type='button' class='btn btn-xs btn-green' value='Edit' ng-click="editProductViewData(cus.member_id);">
</a>
</td>
<td>
<a ui-sref="dashboard.customer.view">
<input type='button' class='btn btn-xs btn-red' value='Delete' ng-click="deleteProductInfoData(cus.member_id);" >
</a>
</td>
</tr>
</tbody>
</table>
<div class="pull-right">
<dir-pagination-controls max-size="5" direction-links="true" boundary-links="true" >
</dir-pagination-controls>
</div>
ここ
ユーザーが3
ページ内にあり、edit
ボタンをクリックしたときに、フォームが以下に示すどのコードが開きます.suppose私はページネーションのためにdir-paginate
使用しています。
$scope.editProductViewData=function(memberid){
$scope.showForm=true;
$scope.ClearbuttonName="Cancel";
$scope.showCancel=true;
}
しかし、私はそれが1st
page.theコードに戻っている最近のケースでは、フォーム内のCancel
ボタンをクリックしていますが、以下に与えられています。
$scope.clearCustomerInfoData=function(){
$state.go('dashboard.customer.view',{}, { reload: true });
}
私の設定ファイルは以下の通りです。
var Admin=angular.module('Spesh',['ui.router', '720kb.datepicker','ngMessages','ngCapsLock','ui.bootstrap','ngFileUpload','angularUtils.directives.dirPagination']);
Admin.run(function($rootScope, $state) {
$rootScope.$state = $state;
});
Admin.config(function($stateProvider, $urlRouterProvider,$locationProvider) {
$urlRouterProvider.otherwise('/');
.state('dashboard', { /* This state defines The root admin login page. */
url: '/dashboard',
templateUrl: 'dashboardview/dashboard.html',
controller: 'adminController'
})
.state('dashboard.customer', {
url: '/customer',
templateUrl: 'dashboardview/customer.html',
controller: 'adminCustomerController'
})
.state('dashboard.customer.new', {
url: '/new',
templateUrl: 'dashboardview/customerNew.html',
controller: 'adminCustomerNewController'
})
.state('dashboard.customer.view', {
url: '/view',
templateUrl: 'dashboardview/customerView.html',
controller: 'adminCustomerViewController'
})
})
はここで私は考え、ユーザーが3rd
ページである必要があり、その後、フォームが.Whenユーザーは、それが戻ってその3rd
ページ第一ではないpage.Pleaseに来る私を助けなければならないCancel
ボタンをクリックします開いて編集ボタンをクリックしました。
に設定されることがありますので、あなたがあなたのdashboard.customer.viewルートやページ番号を設定するには、dir-ページネーション・コントロールの設定を処理する方法を提供することができた場合、それは私たちを助けます。 – krish
@krish;私は自分の投稿を更新し、設定ファイルを添付しました。これを確認してください。 – satya