effective_datatables 1.7.1 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78bd204abaed2266a4181b691f12d54a80fd44e8
|
4
|
+
data.tar.gz: e589cd16e82ce18b1fe771096992d65e79c2c145
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f43d5f8b2e4913c95d18c309e5824d72914aca83fb22f22678e1783d56bcfbdd6a1b4dc797ba40e7fef73cecf51798d07c351e2ccdc0aa7baf15736a60107a41
|
7
|
+
data.tar.gz: 375369ddc8cdc7ec70069dc06c0f6c65097f14019f0b08c35a799dd57018e2b978b2493a473155be975460495b682d77b224229305fb30a23bc4586d02e2d421
|
@@ -62,7 +62,8 @@ initializeDataTables = ->
|
|
62
62
|
# Assign PreSearch columns
|
63
63
|
search_inputs.each (index, input) =>
|
64
64
|
$input = $(input)
|
65
|
-
|
65
|
+
if $input.data('column-index') && $input.val()
|
66
|
+
table.fnSettings().aoPreSearchCols[$input.data('column-index')].sSearch = $input.val()
|
66
67
|
|
67
68
|
# FixedColumns doesn't work well yet.
|
68
69
|
# fixedColumns = new $.fn.dataTable.FixedColumns(table,
|
@@ -20,7 +20,7 @@ module EffectiveDatatablesHelper
|
|
20
20
|
case opts[:filter][:type]
|
21
21
|
when :string, :text, :number
|
22
22
|
form.input name, :label => false, :required => false, :as => :string, :placeholder => (opts[:label] || name),
|
23
|
-
:input_html => { :autocomplete => 'off', :data => {'column-name' => opts[:name], 'column-index' => opts[:index]} }
|
23
|
+
:input_html => { :name => nil, :autocomplete => 'off', :data => {'column-name' => opts[:name], 'column-index' => opts[:index]} }
|
24
24
|
when :select, :boolean
|
25
25
|
if opts[:filter][:values].respond_to?(:call)
|
26
26
|
opts[:filter][:values] = opts[:filter][:values].call()
|
@@ -31,7 +31,7 @@ module EffectiveDatatablesHelper
|
|
31
31
|
end
|
32
32
|
|
33
33
|
form.input name, :label => false, :required => false, :as => :select, :collection => opts[:filter][:values], :include_blank => (opts[:label] || name.titleize),
|
34
|
-
:input_html => { :autocomplete => 'off', :data => {'column-name' => opts[:name], 'column-index' => opts[:index]} }
|
34
|
+
:input_html => { :name => nil, :autocomplete => 'off', :data => {'column-name' => opts[:name], 'column-index' => opts[:index]} }
|
35
35
|
else
|
36
36
|
content_tag(:p, opts[:label] || name)
|
37
37
|
end
|
@@ -21,21 +21,23 @@
|
|
21
21
|
}
|
22
22
|
}
|
23
23
|
|
24
|
-
=
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
24
|
+
form_builder = nil
|
25
|
+
simple_form_for(datatable, url: '#', html: {id: "#{datatable.to_param}-form"}) { |f| form_builder = f }
|
26
|
+
|
27
|
+
%table.effective-datatable{effective_datatable_params}
|
28
|
+
%thead
|
29
|
+
- max_depth = datatable.table_columns.map { |_, opts| opts[:th][:depth].to_i rescue 0 }.max
|
30
|
+
- [*0..max_depth].each do |depth|
|
31
|
+
%tr
|
32
|
+
- table_columns = datatable.table_columns.select { |_, opts| (opts[:th][:depth] || 0 rescue 0) == depth }
|
33
|
+
- table_columns.each do |name, opts|
|
34
|
+
%th{(opts[:th] || {}).merge({:title => opts[:label] || name})}
|
35
|
+
= render_datatable_header_cell(form_builder, name, opts, filterable)
|
36
|
+
- (opts[:append_th] || []).each do |faux_col|
|
37
|
+
%th{(faux_col[:th] || {}).merge({:title => faux_col[:label]})}
|
38
|
+
= faux_col[:label]
|
39
|
+
%tbody
|
40
|
+
- (datatable.to_json[:data] || []).each do |row|
|
41
|
+
%tr
|
42
|
+
- row.each do |col|
|
43
|
+
%td= col.to_s.html_safe
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_datatables
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|