extjs-extjs-mvc 0.1.0 → 0.1.8
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.
- data/VERSION +1 -1
- data/lib/action_controller/controller.rb +1 -4
- data/lib/action_view/helpers/{data/store.rb → store.rb} +12 -3
- data/lib/active_record/model.rb +10 -1
- data/lib/extjs-mvc.rb +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.8
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module ExtJS::
|
1
|
+
module ExtJS::Helpers
|
2
2
|
module Store
|
3
3
|
def extjs_store(params)
|
4
4
|
params[:format] = 'json' if params[:format].nil?
|
@@ -32,8 +32,17 @@ module ExtJS::Data
|
|
32
32
|
end
|
33
33
|
script += "});"
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
|
+
if params[:config]["writer"] # <-- ugly hack because 3.0.1 can't deal with Writer as config-param
|
37
|
+
writer = params[:config].delete("writer")
|
38
|
+
json = params[:config].to_json
|
39
|
+
json[json.length-1] = ','
|
40
|
+
json += "writer:new Ext.data.#{params[:format].capitalize}Writer(#{writer.to_json})}"
|
41
|
+
"new Ext.data.#{type}Store(#{json});#{script}"
|
42
|
+
else
|
43
|
+
"new Ext.data.#{type}Store(#{params[:config].to_json});#{script}"
|
44
|
+
end
|
36
45
|
|
37
46
|
end
|
38
47
|
end
|
39
|
-
end
|
48
|
+
end
|
data/lib/active_record/model.rb
CHANGED
@@ -50,7 +50,16 @@ module ExtJS
|
|
50
50
|
{
|
51
51
|
"fields" => @@fields.collect {|f|
|
52
52
|
col = self.columns.find {|c| c.name.to_sym === f}
|
53
|
-
|
53
|
+
type = col.type
|
54
|
+
case col.type
|
55
|
+
when :datetime || :date || :time || :timestamp
|
56
|
+
type = :date
|
57
|
+
when :text
|
58
|
+
type = :string
|
59
|
+
when :integer
|
60
|
+
type = :int
|
61
|
+
end
|
62
|
+
field = {:name => col.name, :allowBlank => col.null, :type => type}
|
54
63
|
field[:dateFormat] = "c" if col.type === :datetime || col.type === :date # <-- ugly hack for date
|
55
64
|
field
|
56
65
|
},
|
data/lib/extjs-mvc.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: extjs-extjs-mvc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Scott
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-08-
|
12
|
+
date: 2009-08-28 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -39,7 +39,7 @@ files:
|
|
39
39
|
- Rakefile
|
40
40
|
- VERSION
|
41
41
|
- lib/action_controller/controller.rb
|
42
|
-
- lib/action_view/helpers/
|
42
|
+
- lib/action_view/helpers/store.rb
|
43
43
|
- lib/active_record/model.rb
|
44
44
|
- lib/dm/model.rb
|
45
45
|
- lib/extjs-mvc.rb
|