Javascript 可移动分页在动态数据轨道上不起作用
我正在尝试在rails应用程序中使用footable,但无法使用动态表数据实现分页 这是我的密码Javascript 可移动分页在动态数据轨道上不起作用,javascript,jquery,ruby-on-rails,pagination,footable,Javascript,Jquery,Ruby On Rails,Pagination,Footable,我正在尝试在rails应用程序中使用footable,但无法使用动态表数据实现分页 这是我的密码 <table class="footable table table-stripped" data-page-size="10" data-filter=#filter> <thead> <tr> <th>Organization Name</
<table class="footable table table-stripped" data-page-size="10" data-filter=#filter>
<thead>
<tr>
<th>Organization Name</th>
<th>Type</th>
</tr>
</thead>
<tbody>
<%@organizations.each do |org|%>
<tr class="gradeX">
<td><%=org.name%></td>
<td><%=org.type%></td>
</tr>
<%end%>
</tbody>
<tfoot>
<tr>
<td colspan="5">
<ul class="pagination pull-right">
<%=paginate @organizations%>
</ul>
</td>
</tr>
</tfoot>
</table>
<script type="text/javascript">
$(function() {
alert(); //testing
$('.footable').footable();
});
</script>
机构名称
类型
$(函数(){
警报();//测试
$('.footable').footable();
});
但它只显示10条记录,尽管表中最多包含45条记录(即使改变数据页大小,也最多显示10条记录)
如果有人发现这个问题,请提前帮助我,Thaks。不确定您是否仍然存在这个问题,但我偶然发现了这个问题,所以我想我会回答它 发生这种情况的原因是,您正在调用Footable的
分页组件
,这些组件是在您已经通过Rails gem分页的记录上进行的,通过使用
...
<ul class="pagination pull-right">
<%=paginate @organizations%>
</ul>
...
通过JS调用它
$('.footable').footable({
"paging": {
"enabled": true,
"limit": 10
}
});
有关更多信息,请参阅
因此,基本上,可以选择轨道分页或可移动分页,但不能同时选择两者。希望这能有所帮助。不确定您是否仍然存在此问题,但我偶然发现了这个问题,所以我想我会回答它 发生这种情况的原因是,您正在调用Footable的
分页组件
,这些组件是在您已经通过Rails gem分页的记录上进行的,通过使用
...
<ul class="pagination pull-right">
<%=paginate @organizations%>
</ul>
...
通过JS调用它
$('.footable').footable({
"paging": {
"enabled": true,
"limit": 10
}
});
有关更多信息,请参阅
因此,基本上,可以选择轨道分页或可移动分页,但不能同时选择两者。希望这有帮助