根据按钮禁用分页

时间:2019-02-05 15:18:59

标签: html css angularjs

我目前可以通过网上搜索尝试过一些方法,但是很遗憾,我没有找到任何东西。

enter image description here

当我单击替换按钮时,我想禁用分页。由于它正在加载微调器,并且需要等待,所以我认为禁用它而不删除它是有意义的。我知道如何在css端和angularjs上删除。但是,老实说,与我所做的其他工作相比,我不确定如何禁用此特定功能。

HTML:

$scope.handleLoadAndDeactivate = function () {
      $scope.onCompleteData.targetBody.withDeactivation = true;
      onComplete($scope.onCompleteData, $scope.handleLoadAndDeactivateCompleted);
};

AngularJS(按钮):

$scope.operationsPreloadCompletedTableOptions = new NgTableParams({}, {
    dataset: importLog
});
html 

AngularJS(表格):

Project settings / Build / Android Build / Advanced

1 个答案:

答案 0 :(得分:0)

这是您可以实现的方式:

(function () {
	"use strict";
	const app = angular.module("app", []);

	app.controller("app.AppCtrl", ($scope, $timeout) => {
		$scope.disablePagination = false;
		$scope.handleReplace = () => {
			$scope.disablePagination = true;

			//Your replace logic goes here
			$timeout(() => {
				$scope.disablePagination = false;
			}, 2000);
		};
	}
	);

})();
body {
  margin: 20px;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular.min.js"></script>
<div ng-app="app" ng-controller="app.AppCtrl">
  <button ng-disabled="disablePagination">&lt;</button>
  <button ng-disabled="disablePagination">1</button>
  <button ng-disabled="disablePagination">2</button>
  <button ng-disabled="disablePagination">&gt;</button>
  <button ng-click="handleReplace();">Replace</button>
</div>