angular - 角度数据表分页不起作用或搜索
问题描述
对于从 web api 绑定的表,我试图使用基于此的角度数据表
所以这是我的组件
import { Component, OnInit } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { PortfolioEpicService } from 'src/app/shared/portfolio-epic.service';
import { PortfolioEpicModel } from 'src/app/shared/portfolio-epic/portfolio-epic.model';
@Component({
selector: 'app-portfolio',
templateUrl: './portfolio.component.html',
styleUrls: ['./portfolio.component.css']
})
export class PortfolioComponent implements OnInit {
pEpics:any;
dtOptions: DataTables.Settings = {};
constructor(private toastr:ToastrService,public service:PortfolioEpicService) { }
ngOnInit(): void {
this.dtOptions = {
pagingType: 'full_numbers',
pageLength: 5,
processing: true
};
this.refreshAllPortfolioEpics();
}
}
因此,正如预期的那样,创建了数据表(只是绑定了)。但是没有适当的绑定。我的意思是没有分页、没有搜索或数据表功能都不起作用。 我做错了什么??
解决方案
您链接的示例使用 aSubject<any>
作为触发器来通知表重新呈现。
也这样做,它应该按预期工作。
推荐阅读
- ms-access - 我的语法工作而不是编写完整的控制地址。为什么?
- windows - 如何从 DLL 文件中获取一些基本信息?
- c++ - c++ 中没有 timeout_exception 吗?
- sql-server - 运行总计和运行减法
- kubernetes - 如何从同一台计算机访问在 minikube 中运行的 kubernete 服务
- tsql - 数据库中奇怪的日期格式
- ios - admob 测试广告 -> 没有广告可显示
- r - stri_unescape_unicode() 在某些字符上失败
- utf-8 - Windows Xampp 上的 elFinder,不查看非 utf-8 字符的文件
- sql-server - 关系数据库设计 - 用户最喜欢的数据库设计