在Primeng P-table中的Paginator禁用下一个按钮
如果布尔值为false,我想从P-table的Paginator中禁用下一个按钮。
这是我的p-table:
<p-table #dt id="{{id}}_table" [(value)]="_datasrc" [columns]="cols" [rows]="rowNumber || 10"
[paginator]="paginator" [pageLinks]="1" ...
您可以看到我的CSS代码,以便禁用该按钮:
::ng-deep
.ui-paginator-next {
visibility: hidden;
}
如何仅在我的我的布尔值是真的,我想在p-table标签中使用ngclass,但不会影响Paginator
I would like to disable next button from the paginator of p-table if a boolean is false..
Here is my p-table:
<p-table #dt id="{{id}}_table" [(value)]="_datasrc" [columns]="cols" [rows]="rowNumber || 10"
[paginator]="paginator" [pageLinks]="1" ...
You can see my css code in order to disable the button:
::ng-deep
.ui-paginator-next {
visibility: hidden;
}
How to enable the css code only if my boolean is true, I want to use ngClass in p-table tag but it won't affect the paginator
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
像您说的那样,在表中添加一个类,使用ngclass或这样:
在您的CSS Ruleset中,将此类添加到选择器中,例如:
您可以看到demo 在这里。我已经使用了Primeng演示,并添加了我上面写的内容和Paginator的下一个按钮的切换按钮。
注意:班级名称与您写的略有不同。我认为这是由于版本差异所致。
Add a class to the table, like you said, using ngClass or like this:
In your CSS ruleset, add this class to your selector, like this:
You can see a demo here. I've used the primeNG demo and added what I've written above and a toggle button for the paginator's next button.
Note: The class names are slightly different than what you wrote. I assume it's due to version differences.