[英]Using jquery.dataTables.js 1.10.11, the table doesn't initially show additions to tables
I am using "jquery.dataTables.js" 1.10.11.( https://cdn.datatables.net/1.10.11/js/jquery.dataTables.min.js ) The problem is when I add another value, User Name in this case, on my tables the number on the bottom showing number of User Names does not change to show the addition. 我正在使用“ jquery.dataTables.js” 1.10.11。( https://cdn.datatables.net/1.10.11/js/jquery.dataTables.min.js )问题是当我添加另一个值(用户名)时在这种情况下,在我的表上,底部显示用户名数量的数字不会更改以显示添加的内容。 I have to reload the page in order to see the new number. 我必须重新加载页面才能看到新号码。 I need it to automatically load the new number right when the new value is added to the table, not after it reloads. 我需要它在新值添加到表时自动加载新数字,而不是在重新加载后自动加载新数字。 Has anyone used this datatable, and have a solution to this problem? 有没有人使用过此数据表,并且有解决此问题的方法?
Using t.row.add increments the counter as shown on https://datatables.net/examples/api/add_row.html . 使用t.row.add可增加计数器,如https://datatables.net/examples/api/add_row.html所示。
oTable.row.add( [
'Lock',
'Password',
'Comment',
'Groups',
'Roles'
] ).draw();
if your table is serverside based you should use 如果您的表基于服务器端,则应使用
oTable.fnDraw();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.