我在我的rails中包含了以下内容:
gem 'jquery-datatables-rails', github: 'rweng/jquery-datatables-rails'
但是当我启动服务器时,我得到了这个错误:
←[31mYou passed :github as an option for gem 'jquery-datatables-rails', but it is invalid.←[0m
我猜是因为我在locally.BTW上运行它,如果我在本地运行它,我的路径是什么?
我关注的另一件事是:
我还简单地尝试了一下:
gem
下面这段在Typescript中使用jQuery数据表的代码运行良好:
interface JQuery
{
dataTable: any;
}
class Grid extends Widget
{
public data: any;
public someMethod()
{
//apply datatables to the grid element
$('#someId').dataTable(this.data);
}
}
但现在我需要对网格类执行export操作,以便在另一个模块中使用。然
所以我试着运行,允许任何人在我的数据库上运行查询,然后我想在页面上显示结果。由于查询可以返回任意数量的列,因此我在查询返回后计算列数,然后创建表。问题是,我尝试过使用Datatables文档中提供的Bootstrap样式,但是尽管页面按钮的样式正确,但表却没有。
页面附带的html样式正确,生成的类似乎与Bootstrap文档中的类一致,但样式仍未应用。
您可以查看www.dito.ninja上的页面以获取完整的代码。
extends layout
block head
link(rel="stylesheet" type="text/css" hre
我在客户端的一个数据表中加载了超过10000条记录,绑定所有记录需要更多的时间,所以我执行了以下两个步骤
1. first loaded 100 records in datatables using fnAddData() and fnDraw().
2. remaining records loaded to datatables in settimeout function.
加载前100条记录所用的时间非常快,尽管我使用settimeout函数加载了rest记录,但我遇到了以下问题
Page goes to not responding until the records bind