如何解决错误类型错误:无法读取未定义的属性“aDataSort” - 角度 8
希望您能帮助我更正数据表中的“aDataSort”错误。
core.js:6014 ERROR TypeError: Cannot read property 'aDataSort' of undefined
at _fnSortFlatten (jquery.dataTables.js:5928)
at _fnSortingClasses (jquery.dataTables.js:6266)
at loadedInit (jquery.dataTables.js:1208)
at HTMLTableElement.<anonymous> (jquery.dataTables.js:1306)
at Function.each (jquery.js:381)
at jQuery.fn.init.each (jquery.js:203)
at jQuery.fn.init.DataTable [as dataTable] (jquery.dataTables.js:869)
at jQuery.fn.init.$.fn.DataTable (jquery.dataTables.js:15210)
at angular-datatables.directive.js:51
at ZoneDelegate.invokeTask (zone-evergreen.js:391)
在我看来,html中的表格要求表格具有
。 但是当表没有任何记录时,我用“if”隐藏它。<div *ngIf="programaciones?.length==0" class="alert alert-info">
There is no record in the database!
</div>
<div class="table-responsive" >
<table datatable [dtOptions]="dtOptions" [dtTrigger]="dtTrigger" class="row-border hover">
<thead *ngIf="programaciones?.length>0">
<tr >
<th>Id</th>
<th>Consultorio</th>
<th>Usuario</th>
<th>Fecha</th>
<th>Hora</th>
<th>Num. Turno</th>
<th>Editar</th>
<th>Eliminar</th>
</tr>
</thead>
<tbody >
<tr *ngFor="let programacion of programaciones" >
<td>{{programacion.pro_codigo}}</td>
<td>{{programacion.consultorio.con_nombre}}</td>
如何更正此错误,或者在没有记录时是否有其他方法可以隐藏表格。
1 个答案:
答案 0 :(得分:0)
相关问题
最新问题
- 我写了这段代码,但我无法理解我的错误
- 在此代码中是否有使用“this”的替代方法?
- 在 SQL Server 和 PostgreSQL 上查询,我如何从第一个表获得第二个表的可视化
- 为什么我的 Onclick 箭头功能在 React 中不起作用?
- java中的random.expovariate()
- 每千个数字得到
- 是否有可能使 loadstring 不可能等于打印?卢阿
- 启动调试会话时出错 - Google Cloud Shell
- 我无法从一个代码实例的列表中删除 None 值,但我可以在另一个实例中。为什么它适用于一个细分市场而不适用于另一个细分市场?
- Appscript 通过会议在 Google 日历中发送电子邮件和创建活动
解决方法
如何添加 display: none/hidden 而不是使用 ngIf
像这样:
[ngStyle]="programaciones?.length>0 : {'display': 'block'} ? {'display': 'none'}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。