fancygrid 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -93,6 +93,23 @@ to #table_name, this is not necessary.
93
93
  end
94
94
  ```
95
95
 
96
+ ### Add class and id values to table and tr and td table elements
97
+ To add a class or id to either the table, TR, or TD elements you add it to the fancygrid_for block like this:
98
+ ```ruby
99
+ def index
100
+ fancygrid_for :user do |g|
101
+ #...
102
+ g.tr_id do |record|
103
+ "row-#{record.id}"
104
+ end
105
+ # or
106
+ g.tr_id = :row_id
107
+ # same with tr_class, td_id and td_class
108
+ g.table_class = "user_table"
109
+ #same with table_id
110
+ end
111
+ ```
112
+
96
113
  ## Define columns
97
114
  To display attributes as columns use the #attributes method for setup like this:
98
115
  ```ruby
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.3
1
+ 2.0.4
@@ -18,8 +18,10 @@
18
18
  - else
19
19
  = text_field_tag(:value, column.search_value)
20
20
 
21
+ - count = 1
21
22
  - fancygrid.records.each do |record|
22
- %tr.fg-row{ :class => fancygrid.tr_class(record), :id => fancygrid.tr_id(record) }
23
+ - count = 1 - count
24
+ %tr.fg-row{ :class => fancygrid.tr_class(record) + " " + (count == 1 ? "odd" : "even"), :id => fancygrid.tr_id(record) }
23
25
  - fancygrid.visible_columns.each do |column|
24
26
  %td{ :class => column.tag_class + " " + fancygrid.td_class(record).to_s, :id => fancygrid.td_id(record) }
25
27
  = render_fancygrid_cell(record, column, &format_block)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "fancygrid"
8
- s.version = "2.0.3"
8
+ s.version = "2.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alexander Graefenstein"]
12
- s.date = "2013-02-20"
12
+ s.date = "2013-02-21"
13
13
  s.description = "Enables easy table rendering in rails applications"
14
14
  s.email = "giniedp@online.de"
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fancygrid
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-20 00:00:00.000000000 Z
12
+ date: 2013-02-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -185,7 +185,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
185
185
  version: '0'
186
186
  segments:
187
187
  - 0
188
- hash: -3773819786817539840
188
+ hash: 2222543417947051928
189
189
  required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  none: false
191
191
  requirements: