datatablesnet 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -134,7 +134,7 @@ module Datatable
|
|
134
134
|
column_options["fnRender"] = NoEscape.new(options[:render]) if column[:render].present?
|
135
135
|
column_options["fnRender"] = NoEscape.new("function (obj) {return #{column[:format]}(obj.aData[#{column_index}])}") if column[:format].present?
|
136
136
|
if column[:view_link].present? and options[:server_side]
|
137
|
-
column_options["fnRender"] = NoEscape.new("function (obj) {return '<a href = ' + obj.aData[#{columns.length}]['urls']['#{column[:field]}'] + '>' + obj.aData[#{column_index}] + '</a>'}")
|
137
|
+
column_options["fnRender"] = NoEscape.new("function (obj) {if(obj.aData[#{columns.length}]['urls']['#{column[:field]}']!=null) {return '<a href = ' + obj.aData[#{columns.length}]['urls']['#{column[:field]}'] + '>' + obj.aData[#{column_index}] + '</a>'} else {return obj.aData[#{column_index}]} }")
|
138
138
|
end
|
139
139
|
|
140
140
|
unless column_options.empty?
|
@@ -175,7 +175,12 @@ module Datatable
|
|
175
175
|
if column[:view_link] == "."
|
176
176
|
return link_to(obj, row)
|
177
177
|
else
|
178
|
-
|
178
|
+
link_obj = row.send(column[:view_link])
|
179
|
+
if link_obj
|
180
|
+
return link_to(obj, link_obj)
|
181
|
+
else
|
182
|
+
return obj
|
183
|
+
end
|
179
184
|
end
|
180
185
|
else
|
181
186
|
return obj
|
@@ -376,7 +381,12 @@ module Datatable
|
|
376
381
|
if view_link == "."
|
377
382
|
url = url_helper.url_for(row)
|
378
383
|
else
|
379
|
-
|
384
|
+
link_obj = row.send(view_link)
|
385
|
+
if link_obj
|
386
|
+
url = url_helper.url_for(link_obj)
|
387
|
+
else
|
388
|
+
url = nil
|
389
|
+
end
|
380
390
|
end
|
381
391
|
meta[:urls][column[:field]] = url
|
382
392
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 1.1.
|
8
|
+
- 3
|
9
|
+
version: 1.1.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Matt Fields
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-08-
|
17
|
+
date: 2011-08-31 00:00:00 +03:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|