netzke-basepack 0.6.5 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +7 -4
- data/README.md +63 -0
- data/Rakefile +4 -4
- data/javascripts/basepack.js +113 -133
- data/lib/netzke-basepack.rb +9 -2
- data/lib/netzke/basepack.rb +9 -6
- data/lib/netzke/basepack/accordion_panel.rb +1 -1
- data/lib/netzke/basepack/auth_app.rb +28 -21
- data/lib/netzke/basepack/border_layout_panel.rb +9 -57
- data/lib/netzke/basepack/border_layout_panel/javascripts/border_layout_panel.js +40 -0
- data/lib/netzke/basepack/data_accessor.rb +3 -5
- data/lib/netzke/basepack/form_panel.rb +55 -52
- data/lib/netzke/basepack/form_panel/fields.rb +4 -2
- data/lib/netzke/basepack/form_panel/javascripts/comma_list_cbg.js +13 -28
- data/lib/netzke/basepack/form_panel/javascripts/form_panel.js +61 -34
- data/lib/netzke/basepack/form_panel/javascripts/n_radio_group.js +4 -3
- data/lib/netzke/basepack/form_panel/javascripts/readonly_mode.js +10 -10
- data/lib/netzke/basepack/form_panel/services.rb +1 -1
- data/lib/netzke/basepack/grid_panel.rb +23 -17
- data/lib/netzke/basepack/grid_panel/columns.rb +116 -71
- data/lib/netzke/basepack/grid_panel/javascripts/advanced_search.js +5 -7
- data/lib/netzke/basepack/grid_panel/javascripts/check_column_fix.js +6 -0
- data/lib/netzke/basepack/grid_panel/javascripts/edit_in_form.js +18 -15
- data/lib/netzke/basepack/grid_panel/javascripts/event_handling.js +178 -0
- data/lib/netzke/basepack/grid_panel/javascripts/grid_panel.js +230 -454
- data/lib/netzke/basepack/grid_panel/javascripts/rows-dd.js +1 -0
- data/lib/netzke/basepack/grid_panel/record_form_window.rb +8 -8
- data/lib/netzke/basepack/grid_panel/services.rb +12 -15
- data/lib/netzke/basepack/paging_form_panel.rb +1 -82
- data/lib/netzke/basepack/paging_form_panel/javascripts/paging_form_panel.js +76 -0
- data/lib/netzke/basepack/query_builder.rb +4 -4
- data/lib/netzke/basepack/query_builder/javascripts/query_builder.js +7 -4
- data/lib/netzke/basepack/search_panel.rb +1 -1
- data/lib/netzke/basepack/search_panel/javascripts/condition_field.js +27 -20
- data/lib/netzke/basepack/search_panel/javascripts/search_panel.js +4 -4
- data/lib/netzke/basepack/search_window.rb +4 -4
- data/lib/netzke/basepack/simple_app.rb +36 -8
- data/lib/netzke/basepack/simple_app/javascripts/simple_app.js +27 -16
- data/lib/netzke/basepack/tab_panel/javascripts/tab_panel.js +1 -1
- data/lib/netzke/basepack/version.rb +2 -2
- data/lib/netzke/basepack/window.rb +2 -45
- data/lib/netzke/basepack/window/javascripts/window.js +18 -0
- data/lib/netzke/basepack/wrap_lazy_loaded.rb +1 -1
- data/locales/de.yml +79 -0
- data/locales/en.yml +0 -10
- data/netzke-basepack.gemspec +32 -19
- data/stylesheets/basepack.css +16 -16
- data/test/rails_app/.gitignore +1 -0
- data/test/rails_app/Gemfile +9 -5
- data/test/rails_app/Gemfile.lock +51 -49
- data/test/rails_app/app/components/author_form.rb +32 -0
- data/test/rails_app/app/components/book_form.rb +6 -4
- data/test/rails_app/app/components/book_grid.rb +4 -3
- data/test/rails_app/app/components/book_grid_loader.rb +2 -2
- data/test/rails_app/app/components/book_grid_with_custom_columns.rb +11 -5
- data/test/rails_app/app/components/book_grid_with_default_values.rb +1 -1
- data/test/rails_app/app/components/book_grid_with_extra_feedback.rb +11 -0
- data/test/rails_app/app/components/book_grid_with_extra_filters.rb +14 -0
- data/test/rails_app/app/components/book_grid_with_paging.rb +10 -0
- data/test/rails_app/app/components/book_grid_with_persistence.rb +6 -0
- data/test/rails_app/app/components/book_paging_form_panel.rb +3 -3
- data/test/rails_app/app/components/book_with_custom_primary_key_grid.rb +10 -0
- data/test/rails_app/app/components/form_without_model.rb +5 -4
- data/test/rails_app/app/components/paging_form_with_search.rb +3 -2
- data/test/rails_app/app/components/some_auth_app.rb +3 -3
- data/test/rails_app/app/components/some_border_layout.rb +2 -2
- data/test/rails_app/app/components/some_simple_app.rb +6 -5
- data/test/rails_app/app/components/window_component_loader.rb +11 -2
- data/test/rails_app/app/controllers/components_controller.rb +1 -1
- data/test/rails_app/app/models/book_with_custom_primary_key.rb +4 -0
- data/test/rails_app/config/initializers/netzke.rb +6 -0
- data/test/rails_app/config/locales/es.yml +0 -10
- data/test/rails_app/db/migrate/20110701070052_create_book_with_custom_primary_keys.rb +15 -0
- data/test/rails_app/db/schema.rb +12 -2
- data/test/rails_app/db/seeds.rb +21 -1
- data/test/rails_app/features/form_panel.feature +17 -17
- data/test/rails_app/features/grid_panel.feature +20 -4
- data/test/rails_app/features/grid_panel_with_custom_primary_key.feature +15 -0
- data/test/rails_app/features/paging_form_panel.feature +14 -0
- data/test/rails_app/features/search_in_grid.feature +2 -1
- data/test/rails_app/features/simple_app.feature +5 -0
- data/test/rails_app/features/step_definitions/accordion_steps.rb +1 -5
- data/test/rails_app/features/step_definitions/ext_steps.rb +16 -0
- data/test/rails_app/features/step_definitions/form_panel_steps.rb +10 -12
- data/test/rails_app/features/step_definitions/generic_steps.rb +12 -4
- data/test/rails_app/features/step_definitions/grid_panel_steps.rb +47 -32
- data/test/rails_app/features/tab_panel.feature +2 -2
- data/test/rails_app/spec/factories.rb +4 -0
- metadata +26 -13
- data/README.rdoc +0 -67
- data/from_05_to_06.rdoc +0 -2
- data/javascripts/feedback_ghost.js +0 -34
- data/test/rails_app/public/netzke/basepack/ts-checkbox.gif +0 -0
data/stylesheets/basepack.css
CHANGED
@@ -17,7 +17,7 @@ left: -24px;
|
|
17
17
|
*/
|
18
18
|
/* write accordion header in bold */
|
19
19
|
.x-accordion-hd {
|
20
|
-
|
20
|
+
font-weight:bold;
|
21
21
|
}
|
22
22
|
|
23
23
|
/* highilght new records in grid */
|
@@ -32,41 +32,41 @@ left: -24px;
|
|
32
32
|
|
33
33
|
/* Tri-state checkbox */
|
34
34
|
.x-form-tscheckbox {
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
35
|
+
height: 13px;
|
36
|
+
width: 13px;
|
37
|
+
background: url('basepack/ts-checkbox.gif') no-repeat 0 0;
|
38
|
+
vertical-align: bottom;
|
39
39
|
}
|
40
40
|
.x-checkbox-checked .x-form-tscheckbox {
|
41
|
-
|
41
|
+
background-position:0 -13px;
|
42
42
|
}
|
43
43
|
.x-checkbox-undef .x-form-tscheckbox {
|
44
|
-
|
44
|
+
background-position:0 -26px;
|
45
45
|
}
|
46
46
|
.x-item-disabled .x-form-tscheckbox {
|
47
|
-
|
47
|
+
background-position:-39px 0;
|
48
48
|
}
|
49
49
|
.x-form-check-over .x-form-tscheckbox {
|
50
|
-
|
50
|
+
background-position: -13px 0;
|
51
51
|
}
|
52
52
|
.x-form-check-down .x-form-tscheckbox {
|
53
|
-
|
53
|
+
background-position:-26px 0;
|
54
54
|
}
|
55
55
|
.x-checkbox-checked .x-form-check-over .x-form-tscheckbox {
|
56
|
-
|
56
|
+
background-position:-13px -13px;
|
57
57
|
}
|
58
58
|
.x-checkbox-checked .x-form-check-down .x-form-tscheckbox {
|
59
|
-
|
59
|
+
background-position:-26px -13px;
|
60
60
|
}
|
61
61
|
.x-checkbox-checked.x-item-disabled .x-form-tscheckbox {
|
62
|
-
|
62
|
+
background-position:-39px -13px;
|
63
63
|
}
|
64
64
|
.x-checkbox-undef .x-form-check-over .x-form-tscheckbox {
|
65
|
-
|
65
|
+
background-position:-13px -26px;
|
66
66
|
}
|
67
67
|
.x-checkbox-undef .x-form-check-down .x-form-tscheckbox {
|
68
|
-
|
68
|
+
background-position:-26px -26px;
|
69
69
|
}
|
70
70
|
.x-checkbox-undef.x-item-disabled .x-form-tscheckbox {
|
71
|
-
|
71
|
+
background-position:-39px -26px;
|
72
72
|
}
|
data/test/rails_app/.gitignore
CHANGED
data/test/rails_app/Gemfile
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
2
|
|
3
|
-
gem 'rails', '3.0.
|
3
|
+
gem 'rails', '~>3.0.9'
|
4
|
+
|
5
|
+
gem 'mysql2', '~>0.2.0'
|
4
6
|
|
5
7
|
gem 'netzke-core', :path => File.expand_path('../vendor/gems/netzke-core', __FILE__)
|
6
8
|
gem 'netzke-persistence', :path => File.expand_path('../vendor/gems/netzke-persistence', __FILE__)
|
7
9
|
|
8
|
-
|
10
|
+
# We need to manually include these Basepack dependencies, because we're not including Basepack as a gem
|
11
|
+
gem 'will_paginate', '~>3.0'
|
9
12
|
gem 'meta_where'
|
10
13
|
gem 'acts_as_list'
|
11
14
|
|
12
|
-
gem 'mysql2', '~>0.2.0'
|
13
|
-
|
14
15
|
# Bundle gems for the local environment. Make sure to
|
15
16
|
# put test-only gems in this group so their generators
|
16
17
|
# and rake tasks are available in development mode:
|
@@ -24,8 +25,11 @@ group :development, :test do
|
|
24
25
|
gem 'factory_girl'
|
25
26
|
end
|
26
27
|
|
28
|
+
group :development do
|
29
|
+
end
|
30
|
+
|
27
31
|
group :test do
|
28
32
|
gem 'sqlite3-ruby', :require => 'sqlite3'
|
29
33
|
gem 'pickle'
|
30
|
-
gem 'database_cleaner'
|
34
|
+
gem 'database_cleaner'
|
31
35
|
end
|
data/test/rails_app/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: vendor/gems/netzke-core
|
3
3
|
specs:
|
4
|
-
netzke-core (0.
|
5
|
-
activesupport (
|
4
|
+
netzke-core (0.7.0)
|
5
|
+
activesupport (~> 3.0.0)
|
6
6
|
|
7
7
|
PATH
|
8
8
|
remote: vendor/gems/netzke-persistence
|
@@ -13,33 +13,34 @@ GEM
|
|
13
13
|
remote: http://rubygems.org/
|
14
14
|
specs:
|
15
15
|
abstract (1.0.0)
|
16
|
-
actionmailer (3.0.
|
17
|
-
actionpack (= 3.0.
|
18
|
-
mail (~> 2.2.
|
19
|
-
actionpack (3.0.
|
20
|
-
activemodel (= 3.0.
|
21
|
-
activesupport (= 3.0.
|
16
|
+
actionmailer (3.0.9)
|
17
|
+
actionpack (= 3.0.9)
|
18
|
+
mail (~> 2.2.19)
|
19
|
+
actionpack (3.0.9)
|
20
|
+
activemodel (= 3.0.9)
|
21
|
+
activesupport (= 3.0.9)
|
22
22
|
builder (~> 2.1.2)
|
23
23
|
erubis (~> 2.6.6)
|
24
|
-
i18n (~> 0.
|
24
|
+
i18n (~> 0.5.0)
|
25
25
|
rack (~> 1.2.1)
|
26
|
-
rack-mount (~> 0.6.
|
26
|
+
rack-mount (~> 0.6.14)
|
27
27
|
rack-test (~> 0.5.7)
|
28
28
|
tzinfo (~> 0.3.23)
|
29
|
-
activemodel (3.0.
|
30
|
-
activesupport (= 3.0.
|
29
|
+
activemodel (3.0.9)
|
30
|
+
activesupport (= 3.0.9)
|
31
31
|
builder (~> 2.1.2)
|
32
|
-
i18n (~> 0.
|
33
|
-
activerecord (3.0.
|
34
|
-
activemodel (= 3.0.
|
35
|
-
activesupport (= 3.0.
|
36
|
-
arel (~> 2.0.
|
32
|
+
i18n (~> 0.5.0)
|
33
|
+
activerecord (3.0.9)
|
34
|
+
activemodel (= 3.0.9)
|
35
|
+
activesupport (= 3.0.9)
|
36
|
+
arel (~> 2.0.10)
|
37
37
|
tzinfo (~> 0.3.23)
|
38
|
-
activeresource (3.0.
|
39
|
-
activemodel (= 3.0.
|
40
|
-
activesupport (= 3.0.
|
41
|
-
activesupport (3.0.
|
42
|
-
acts_as_list (0.1.
|
38
|
+
activeresource (3.0.9)
|
39
|
+
activemodel (= 3.0.9)
|
40
|
+
activesupport (= 3.0.9)
|
41
|
+
activesupport (3.0.9)
|
42
|
+
acts_as_list (0.1.4)
|
43
|
+
addressable (2.2.6)
|
43
44
|
arel (2.0.10)
|
44
45
|
builder (2.1.2)
|
45
46
|
capybara (1.0.0)
|
@@ -49,10 +50,9 @@ GEM
|
|
49
50
|
rack-test (>= 0.5.4)
|
50
51
|
selenium-webdriver (~> 0.2.0)
|
51
52
|
xpath (~> 0.1.4)
|
52
|
-
childprocess (0.
|
53
|
+
childprocess (0.2.0)
|
53
54
|
ffi (~> 1.0.6)
|
54
|
-
|
55
|
-
cucumber (1.0.1)
|
55
|
+
cucumber (1.0.2)
|
56
56
|
builder (>= 2.1.2)
|
57
57
|
diff-lcs (>= 1.1.2)
|
58
58
|
gherkin (~> 2.4.5)
|
@@ -66,16 +66,15 @@ GEM
|
|
66
66
|
diff-lcs (1.1.2)
|
67
67
|
erubis (2.6.6)
|
68
68
|
abstract (>= 1.0.0)
|
69
|
-
factory_girl (
|
69
|
+
factory_girl (2.0.3)
|
70
70
|
ffi (1.0.9)
|
71
|
-
gherkin (2.4.
|
71
|
+
gherkin (2.4.6)
|
72
72
|
json (>= 1.4.6)
|
73
|
-
i18n (0.
|
73
|
+
i18n (0.5.0)
|
74
74
|
json (1.5.3)
|
75
75
|
json_pure (1.5.3)
|
76
|
-
launchy (0.
|
77
|
-
|
78
|
-
rake (>= 0.8.1)
|
76
|
+
launchy (2.0.5)
|
77
|
+
addressable (~> 2.2.6)
|
79
78
|
mail (2.2.19)
|
80
79
|
activesupport (>= 2.3.6)
|
81
80
|
i18n (>= 0.4.0)
|
@@ -88,29 +87,31 @@ GEM
|
|
88
87
|
mime-types (1.16)
|
89
88
|
mysql2 (0.2.11)
|
90
89
|
nokogiri (1.5.0)
|
91
|
-
pickle (0.4.
|
90
|
+
pickle (0.4.8)
|
92
91
|
cucumber (>= 0.8)
|
93
92
|
rake
|
94
|
-
polyglot (0.3.
|
93
|
+
polyglot (0.3.2)
|
95
94
|
rack (1.2.3)
|
96
95
|
rack-mount (0.6.14)
|
97
96
|
rack (>= 1.0.0)
|
98
97
|
rack-test (0.5.7)
|
99
98
|
rack (>= 1.0)
|
100
|
-
rails (3.0.
|
101
|
-
actionmailer (= 3.0.
|
102
|
-
actionpack (= 3.0.
|
103
|
-
activerecord (= 3.0.
|
104
|
-
activeresource (= 3.0.
|
105
|
-
activesupport (= 3.0.
|
99
|
+
rails (3.0.9)
|
100
|
+
actionmailer (= 3.0.9)
|
101
|
+
actionpack (= 3.0.9)
|
102
|
+
activerecord (= 3.0.9)
|
103
|
+
activeresource (= 3.0.9)
|
104
|
+
activesupport (= 3.0.9)
|
106
105
|
bundler (~> 1.0)
|
107
|
-
railties (= 3.0.
|
108
|
-
railties (3.0.
|
109
|
-
actionpack (= 3.0.
|
110
|
-
activesupport (= 3.0.
|
106
|
+
railties (= 3.0.9)
|
107
|
+
railties (3.0.9)
|
108
|
+
actionpack (= 3.0.9)
|
109
|
+
activesupport (= 3.0.9)
|
111
110
|
rake (>= 0.8.7)
|
111
|
+
rdoc (~> 3.4)
|
112
112
|
thor (~> 0.14.4)
|
113
113
|
rake (0.9.2)
|
114
|
+
rdoc (3.9.1)
|
114
115
|
rspec (2.6.0)
|
115
116
|
rspec-core (~> 2.6.0)
|
116
117
|
rspec-expectations (~> 2.6.0)
|
@@ -131,15 +132,16 @@ GEM
|
|
131
132
|
json_pure
|
132
133
|
rubyzip
|
133
134
|
spork (0.8.5)
|
134
|
-
sqlite3 (1.3.
|
135
|
+
sqlite3 (1.3.4)
|
135
136
|
sqlite3-ruby (1.3.3)
|
136
137
|
sqlite3 (>= 1.3.3)
|
137
|
-
term-ansicolor (1.0.
|
138
|
+
term-ansicolor (1.0.6)
|
138
139
|
thor (0.14.6)
|
139
|
-
treetop (1.4.
|
140
|
+
treetop (1.4.10)
|
141
|
+
polyglot
|
140
142
|
polyglot (>= 0.3.1)
|
141
143
|
tzinfo (0.3.29)
|
142
|
-
will_paginate (3.0.
|
144
|
+
will_paginate (3.0.0)
|
143
145
|
xpath (0.1.4)
|
144
146
|
nokogiri (~> 1.3)
|
145
147
|
|
@@ -159,8 +161,8 @@ DEPENDENCIES
|
|
159
161
|
netzke-core!
|
160
162
|
netzke-persistence!
|
161
163
|
pickle
|
162
|
-
rails (
|
164
|
+
rails (~> 3.0.9)
|
163
165
|
rspec-rails
|
164
166
|
spork
|
165
167
|
sqlite3-ruby
|
166
|
-
will_paginate (
|
168
|
+
will_paginate (~> 3.0)
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Warning: this component participates in i18n.feature, careful with adding new fields!
|
2
|
+
class AuthorForm < Netzke::Basepack::FormPanel
|
3
|
+
js_property :title, Author.model_name.human
|
4
|
+
|
5
|
+
def configuration
|
6
|
+
super.merge(
|
7
|
+
:model => "Author",
|
8
|
+
# :record => Author.first,
|
9
|
+
# :items => [
|
10
|
+
# :title,
|
11
|
+
# {:name => :author__first_name, :setter => author_first_name_setter},
|
12
|
+
# {:name => :author__last_name, :xtype => :displayfield},
|
13
|
+
# {:name => :author__updated_at, :editable => false},
|
14
|
+
# :digitized,
|
15
|
+
# :exemplars,
|
16
|
+
# {:name => :in_abundance, :getter => in_abundance_getter, :xtype => :displayfield},
|
17
|
+
# {:name => :tags, :xtype => :commalistcbg, :options => %w(read cool recommend buy)},
|
18
|
+
# {:name => :rating, :xtype => :nradiogroup, :options => [[1, "Good"], [2, "Average"], [3, "Poor"]]}
|
19
|
+
# ]
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
# js_method :init_component, <<-JS
|
24
|
+
# function(){
|
25
|
+
# Netzke.classes.AuthorForm.superclass.initComponent.call(this);
|
26
|
+
|
27
|
+
# this.on('submitsuccess', function(){ this.feedback('Suc'+'cess!')}, this);
|
28
|
+
# }
|
29
|
+
# JS
|
30
|
+
|
31
|
+
|
32
|
+
end
|
@@ -12,20 +12,22 @@ class BookForm < Netzke::Basepack::FormPanel
|
|
12
12
|
:title,
|
13
13
|
{:name => :author__first_name, :setter => author_first_name_setter},
|
14
14
|
{:name => :author__last_name, :xtype => :displayfield},
|
15
|
+
{:name => :rating, :xtype => :combo, :store => [[1, "Good"], [2, "Average"], [3, "Poor"]]},
|
15
16
|
{:name => :author__updated_at, :editable => false},
|
16
17
|
:digitized,
|
17
18
|
:exemplars,
|
18
19
|
{:name => :in_abundance, :getter => in_abundance_getter, :xtype => :displayfield},
|
19
|
-
|
20
|
-
{:name => :
|
20
|
+
# WIP: commalistcbg is kind of broken, giving an Ext error
|
21
|
+
# {:name => :tags, :xtype => :commalistcbg, :options => %w(read cool recommend buy)},
|
22
|
+
# WIP: waithing on nradiogroup
|
23
|
+
# {:name => :rating, :xtype => :nradiogroup, :options => [[1, "Good"], [2, "Average"], [3, "Poor"]]}
|
21
24
|
]
|
22
25
|
)
|
23
26
|
end
|
24
27
|
|
25
28
|
js_method :init_component, <<-JS
|
26
29
|
function(){
|
27
|
-
|
28
|
-
|
30
|
+
this.callParent();
|
29
31
|
this.on('submitsuccess', function(){ this.feedback('Suc'+'cess!')}, this);
|
30
32
|
}
|
31
33
|
JS
|
@@ -1,11 +1,12 @@
|
|
1
1
|
class BookGrid < Netzke::Basepack::GridPanel
|
2
|
-
|
3
|
-
js_property :title, "Books"
|
2
|
+
js_property :title, I18n.t('books', :default => "Books")
|
4
3
|
|
5
4
|
def default_config
|
6
5
|
super.merge(
|
7
6
|
:model => "Book",
|
8
|
-
:
|
7
|
+
# :prohibit_update => true
|
8
|
+
# :columns => [{:name => :author__first_name, :read_only => true}, :exemplars, {:name => :digitized, :xtype => :checkcolumn, :editable => false}]
|
9
|
+
# :columns => [{:name => :title, :editable => false, :editor => {:xtype => :datefield}}, :exemplars, :digitized, :notes]
|
9
10
|
)
|
10
11
|
end
|
11
12
|
end
|
@@ -9,13 +9,13 @@ class BookGridLoader < Netzke::Base
|
|
9
9
|
|
10
10
|
js_method :on_load_one, <<-JS
|
11
11
|
function(){
|
12
|
-
this.
|
12
|
+
this.loadNetzkeComponent({name: 'book_grid_one', container: this.id});
|
13
13
|
}
|
14
14
|
JS
|
15
15
|
|
16
16
|
js_method :on_load_two, <<-JS
|
17
17
|
function(){
|
18
|
-
this.
|
18
|
+
this.loadNetzkeComponent({name: 'book_grid_two', container: this.id});
|
19
19
|
}
|
20
20
|
JS
|
21
21
|
|
@@ -5,11 +5,11 @@ class BookGridWithCustomColumns < Netzke::Basepack::GridPanel
|
|
5
5
|
super.merge(
|
6
6
|
:model => "Book",
|
7
7
|
:columns => [
|
8
|
-
{:name => :author__first_name},
|
8
|
+
{:name => :author__first_name, :renderer => :my_renderer},
|
9
9
|
{:name => :author__last_name, :renderer => :uppercase},
|
10
|
-
:author__name,
|
11
|
-
:title,
|
12
|
-
:digitized,
|
10
|
+
{:name => :author__name, :flex => 1, :text => "Author"},
|
11
|
+
{:name => :title, :flex => 1},
|
12
|
+
{:name => :digitized},
|
13
13
|
{
|
14
14
|
:name => :rating,
|
15
15
|
:editor => {
|
@@ -20,9 +20,15 @@ class BookGridWithCustomColumns < Netzke::Basepack::GridPanel
|
|
20
20
|
:renderer => "function(v){return ['', 'Good', 'Average', 'Poor'][v];}"
|
21
21
|
},
|
22
22
|
:exemplars,
|
23
|
-
:updated_at
|
23
|
+
{:name => :updated_at}
|
24
24
|
]
|
25
25
|
)
|
26
26
|
end
|
27
27
|
|
28
|
+
js_method :my_renderer, <<-JS
|
29
|
+
function(value){
|
30
|
+
return value ? "*" + value + "*" : "";
|
31
|
+
}
|
32
|
+
JS
|
33
|
+
|
28
34
|
end
|
@@ -4,7 +4,7 @@ class BookGridWithDefaultValues < Netzke::Basepack::GridPanel
|
|
4
4
|
def default_config
|
5
5
|
super.merge(
|
6
6
|
:model => "Book",
|
7
|
-
:columns => [{:name => '
|
7
|
+
:columns => [{:name => 'title', :default_value => "Lolita"}, {:name => 'author__last_name', :default_value => Author.first.id}, {:name => 'exemplars', :default_value => 100}, {:name => 'digitized', :default_value => true}]
|
8
8
|
)
|
9
9
|
end
|
10
10
|
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# This requires a patch to Ext examples/ux/grid
|
2
|
+
class BookGridWithExtraFilters < Netzke::Basepack::GridPanel
|
3
|
+
js_include Netzke::Core.ext_path.join("examples", "ux/grid/filter/EneFilter.js")
|
4
|
+
js_include Netzke::Core.ext_path.join("examples", "ux/grid/menu/EneMenu.js")
|
5
|
+
|
6
|
+
Netzke::Core.external_ext_css << "#{Netzke::Core.ext_uri}/examples/ux/grid/css/EneMenu"
|
7
|
+
|
8
|
+
def default_config
|
9
|
+
super.merge(
|
10
|
+
:model => "Book",
|
11
|
+
:columns => [{:name => :title, :filter => {:type => :ene}}, :exemplars, :digitized, :notes]
|
12
|
+
)
|
13
|
+
end
|
14
|
+
end
|