简体   繁体   English

你能为Ruby on Rails推荐好的数据网格类/ gem吗?

[英]Can you recommend good data grid class/gem for Ruby on Rails?

Can you recommend good data grid class/gem for Ruby on Rails? 你能为Ruby on Rails推荐好的数据网格类/ gem吗? Like http://code.google.com/p/zend-framework-datagrid/ for ZF 与ZF的http://code.google.com/p/zend-framework-datagrid/一样

You can also try datagrid gem. 您还可以尝试datagrid gem。 That is focused not only grids with columns but also filters. 这不仅关注具有列的网格,还关注过滤器。

class SimpleReport

  include Datagrid

  scope do
    User.includes(:group)
  end

  filter(:category, :enum, :select => ["first", "second"])
  filter(:disabled, :eboolean)
  filter(:confirmed, :boolean)
  filter(:group_id, :integer, :multiple => true)
  integer_range_filter(:logins_count, :integer)
  filter(:group_name, :string, :header => "Group") do |value|
    self.joins(:group).where(:groups => {:name => value})
  end


  column(:name)
  column(:group, :order => "groups.name") do |user|
    user.name
  end
  column(:active, :header => "Activated") do |user|
    !user.disabled
  end
end

不确定这是否是你要找的,但结帐https://github.com/wice/wice_grid

If you are looking for a powerful client-side grid, supporting pagination, sorting, grouping, editing, export to Excel, PDF, etc, you can check Shield UI's Grid component. 如果您正在寻找功能强大的客户端网格,支持分页,排序,分组,编辑,导出到Excel,PDF等,您可以检查Shield UI的网格组件。

Here's a tutorial on how to integrate it in Rails. 这是一个关于如何将它集成到Rails中的教程

If you are looking for things like pagination, ordering, sorting etc, then rails does all this automatically. 如果您正在寻找分页,订购,排序等内容,那么rails会自动完成所有这些操作。

So, for example if you wanted to sort all row by a particular column, then the title of that column could simply be a link that sorted the results by that column and then re rendered the grid. 因此,例如,如果您想按特定列对所有行进行排序,那么该列的标题可能只是一个按该列对结果进行排序然后重新呈现网格的链接。

So if you want to build a data grid that isn't AJAXy then this is pretty simple. 因此,如果您想构建一个非AJAXy的数据网格,那么这非常简单。 If you are looking for a way to do it with XHR requests then you can use jQuery to make requests in the background. 如果您正在寻找使用XHR请求的方法,那么您可以使用jQuery在后台发出请求。

As fas as a gem that does all this automatically, I couldn't find one, but I can't see why you couldn't do it yourself easily with the foundations that rails provides. 作为一个自动完成所有这一切的宝石,我找不到一个,但我不明白为什么你不能轻易地用铁轨提供的基础自己做。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 您可以推荐浏览器中的Ruby / Rails 3D渲染器吗? - Can you recommend an in-browser Ruby/Rails 3D renderer? Ruby on Rails:您是否建议使用Observers? - Ruby on Rails: Do you recommend using Observers? 谁能推荐一个搜索用的宝石,它实际上可以让我轻松地将结果过滤在红宝石上? - Can anyone recommend a gem for searching that actually allows me to easily filter my results in ruby on rails? 你能推荐一个使用 Rails 3 生成 facebook 风格消息收件箱的插件或 gem 吗? - Can you recommend a plugin or gem that generates a facebook-style message inbox using Rails 3? 您建议使用哪种Ruby on Rails插件/ gem在自定义博客中实现广泛使用的博客发布API(Atom,MetaWeblog等) - What Ruby on Rails plugin/gem would you recommend to implement widely-used blog publishing API (Atom, MetaWeblog, etc) in a custom blog 宝石还是插件,对Ruby on Rails项目有什么好处 - Gem or Plugin , what is good for a ruby on rails project 哪个宝石适合APNS持久连接ruby on rails? - Which gem is good for APNS persistent connection for ruby on rails? 在 Rails 上使用 Ruby 您可以使用会话和身份验证(gem bcrypt)拥有多种用户类型吗? - Using Ruby on rails can you have multiple user types using sessions and authentication (gem bcrypt)? 当您仅将一行代码包含在Rails应用程序中时,为什么将ruby gem用于引导程序? - Why use ruby gem for bootstrap when you can just one line include bootstrap in a rails app? Ruby on Rails:无法安装JSON gem - Ruby on Rails: Can't install JSON gem
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM