netzke-basepack 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +14 -6
- data/README.rdoc +16 -31
- data/Rakefile +22 -16
- data/TODO.rdoc +1 -1
- data/app/models/netzke_field_list.rb +29 -29
- data/app/models/netzke_model_attr_list.rb +4 -4
- data/app/models/netzke_persistent_array_auto_model.rb +9 -9
- data/config/database.yml +2 -35
- data/features/accordion_panel.feature +1 -1
- data/features/form_panel.feature +2 -2
- data/features/grid_panel.feature +15 -3
- data/features/search_in_grid.feature +4 -4
- data/features/simple_panel.feature +4 -4
- data/features/step_definitions/pickle_steps.rb +2 -2
- data/features/step_definitions/web_steps.rb +5 -5
- data/features/support/env.rb +6 -6
- data/features/tab_panel.feature +1 -1
- data/javascripts/basepack.js +28 -28
- data/lib/netzke-basepack.rb +5 -5
- data/lib/netzke/active_record.rb +1 -1
- data/lib/netzke/active_record/association_attributes.rb +9 -9
- data/lib/netzke/active_record/attributes.rb +24 -23
- data/lib/netzke/active_record/combobox_options.rb +3 -3
- data/lib/netzke/active_record/relation_extensions.rb +4 -4
- data/lib/netzke/basepack.rb +4 -4
- data/{app/components → lib}/netzke/basepack/accordion_panel.rb +7 -7
- data/{app/components → lib}/netzke/basepack/basic_app.rb +18 -18
- data/{app/components → lib}/netzke/basepack/basic_app/statusbar_ext.js +0 -0
- data/lib/netzke/basepack/border_layout_panel.rb +101 -0
- data/{app/components → lib}/netzke/basepack/form_panel.rb +21 -21
- data/{app/components → lib}/netzke/basepack/form_panel/fields.rb +29 -36
- data/{app/components → lib}/netzke/basepack/form_panel/javascripts/netzkefileupload.js +0 -0
- data/{app/components → lib}/netzke/basepack/form_panel/javascripts/pre.js +9 -9
- data/{app/components → lib}/netzke/basepack/form_panel/javascripts/xcheckbox.js +1 -1
- data/{app/components → lib}/netzke/basepack/form_panel/services.rb +11 -11
- data/{app/components → lib}/netzke/basepack/grid_panel.rb +74 -92
- data/{app/components → lib}/netzke/basepack/grid_panel/columns.rb +34 -36
- data/{app/components → lib}/netzke/basepack/grid_panel/javascript.rb +7 -7
- data/{app/components → lib}/netzke/basepack/grid_panel/javascripts/advanced_search.js +10 -10
- data/{app/components → lib}/netzke/basepack/grid_panel/javascripts/edit_in_form.js +2 -2
- data/{app/components → lib}/netzke/basepack/grid_panel/javascripts/pre.js +31 -31
- data/{app/components → lib}/netzke/basepack/grid_panel/javascripts/rows-dd.js +1 -1
- data/{app/components → lib}/netzke/basepack/grid_panel/multi_edit_form.rb +2 -2
- data/{app/components → lib}/netzke/basepack/grid_panel/record_form_window.rb +3 -3
- data/{app/components → lib}/netzke/basepack/grid_panel/search_window.rb +11 -11
- data/{app/components → lib}/netzke/basepack/grid_panel/services.rb +28 -28
- data/{app/components → lib}/netzke/basepack/panel.rb +0 -0
- data/{app/components → lib}/netzke/basepack/search_panel.rb +11 -11
- data/{app/components → lib}/netzke/basepack/tab_panel.rb +7 -7
- data/lib/netzke/basepack/version.rb +1 -1
- data/{app/components → lib}/netzke/basepack/window.rb +14 -14
- data/{app/components → lib}/netzke/basepack/wrapper.rb +6 -6
- data/lib/netzke/data_accessor.rb +18 -18
- data/lib/netzke/fields_configurator.rb +30 -30
- data/lib/netzke/json_array_editor.rb +9 -9
- data/lib/netzke/masquerade_selector.rb +5 -5
- data/locale/en.yml +1 -1
- data/netzke-basepack.gemspec +252 -240
- data/spec/active_record/attributes_spec.rb +6 -1
- data/spec/active_record/relation_extensions_spec.rb +11 -11
- data/spec/components/form_panel_spec.rb +13 -19
- data/spec/components/grid_panel_spec.rb +1 -1
- data/test/rails_app/Gemfile +4 -3
- data/test/rails_app/Gemfile.lock +42 -50
- data/test/rails_app/app/components/book_grid.rb +4 -0
- data/test/rails_app/app/components/generic_user_form.rb +2 -2
- data/test/rails_app/app/components/simple_basic_app.rb +3 -3
- data/test/rails_app/app/components/simple_panel.rb +1 -1
- data/test/rails_app/app/components/some_border_layout.rb +12 -11
- data/test/rails_app/app/components/some_search_panel.rb +5 -5
- data/test/rails_app/app/components/user_form.rb +1 -1
- data/test/rails_app/app/components/window_component_loader.rb +2 -2
- data/test/rails_app/app/models/author.rb +7 -0
- data/test/rails_app/app/models/book.rb +3 -0
- data/test/rails_app/app/models/user.rb +1 -1
- data/test/rails_app/config/locales/es.yml +0 -1
- data/test/rails_app/config/routes.rb +2 -2
- data/test/rails_app/db/development_structure.sql +28 -3
- data/test/rails_app/db/migrate/20101026185816_create_authors.rb +14 -0
- data/test/rails_app/db/migrate/20101026190021_create_books.rb +17 -0
- data/test/rails_app/db/schema.rb +18 -1
- data/test/rails_app/public/javascripts/effects.js +1 -1
- data/test/rails_app/spec/models/author_spec.rb +5 -0
- data/test/rails_app/spec/models/book_spec.rb +5 -0
- data/test/test_helper.rb +1 -1
- data/test/unit/accordion_panel_test.rb +2 -2
- data/test/unit/active_record_basepack_test.rb +9 -9
- data/test/unit/fields_configuration_test.rb +4 -4
- data/test/unit/grid_panel_test.rb +8 -8
- data/test/unit/tab_panel_test.rb +2 -2
- metadata +49 -36
- data/.gitignore +0 -10
- data/app/components/netzke/basepack/border_layout_panel.rb +0 -39
@@ -4,11 +4,16 @@ describe Netzke::ActiveRecord::Attributes do
|
|
4
4
|
it "should return Netzke attributes in natural order" do
|
5
5
|
User.send(:netzke_attrs_in_natural_order).map{ |a| a[:name] }.should == %w(id first_name last_name role__name created_at updated_at)
|
6
6
|
end
|
7
|
-
|
7
|
+
|
8
8
|
it "should return exposed Netzke attributes" do
|
9
9
|
class UserExt < User
|
10
10
|
netzke_expose_attributes :first_name, :created_at
|
11
11
|
end
|
12
12
|
UserExt.netzke_attributes.map{ |a| a[:name] }.should == %w(id first_name created_at)
|
13
13
|
end
|
14
|
+
|
15
|
+
it "should return Netzke attributes including an association attribute represented by a virtual method" do
|
16
|
+
Book.netzke_attributes.map{ |a| a[:name] }.should == %w(id author__name title exemplars digitized notes created_at updated_at)
|
17
|
+
Book.netzke_attributes.detect{ |a| a[:name] == "author__name" }[:attr_type].should == :string
|
18
|
+
end
|
14
19
|
end
|
@@ -6,31 +6,31 @@ describe Netzke::ActiveRecord::RelationExtensions do
|
|
6
6
|
10.times do |i|
|
7
7
|
Factory(:user, :first_name => "First Name #{i}", :role_id => i)
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
User.scope(:role_id_gt_7, User.where(["role_id > ?", 7]))
|
11
11
|
User.scope(:role_id_gt, lambda{ |param| User.where(["role_id > ?", param]) })
|
12
|
-
|
12
|
+
|
13
13
|
# Tests
|
14
14
|
User.where({}).extend_with(["role_id >= ?", 5]).count.should == 5
|
15
|
-
|
15
|
+
|
16
16
|
User.where({}).extend_with(:role_id_gt_7).count.should == 2
|
17
|
-
|
17
|
+
|
18
18
|
User.where({}).extend_with(:role_id_gt, 2).count.should == 7
|
19
|
-
|
19
|
+
|
20
20
|
User.where({}).extend_with([:role_id_gt, 3]).count.should == 6
|
21
|
-
|
21
|
+
|
22
22
|
User.where({}).extend_with(:role_id => 5).first.first_name.should == "First Name 5"
|
23
|
-
|
23
|
+
|
24
24
|
User.where(["role_id < ?", 7]).extend_with(lambda{ |relation| relation.where(["role_id > ?", 4]) }).count.should == 2
|
25
|
-
|
25
|
+
|
26
26
|
# User.where({}).extend_with("select * from users where role_id > 6").all.size.should == 3
|
27
|
-
|
27
|
+
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
it "should be extendable with extend_with_netzke_conditions" do
|
31
31
|
# Preparations
|
32
32
|
roles = [Factory(:role, :name => "admin"), Factory(:role, :name => "user"), Factory(:role, :name => "superadmin")]
|
33
|
-
|
33
|
+
|
34
34
|
# 3 users of each role
|
35
35
|
9.times do |i|
|
36
36
|
Factory(:user, :role_id => roles[i%3].id)
|
@@ -5,49 +5,49 @@ describe Netzke::Basepack::FormPanel do
|
|
5
5
|
form = Netzke::Basepack::FormPanel.new(:model => 'User')
|
6
6
|
form.fields_from_model.keys.map(&:to_s).sort.should == %w(created_at first_name id last_name role__name updated_at)
|
7
7
|
end
|
8
|
-
|
8
|
+
|
9
9
|
it "should extract fields from config" do
|
10
10
|
form = Netzke::Basepack::FormPanel.new(:model => 'User', :items => [{:xtype => 'fieldset', :items => [:first_name, {:name => "last_name"}]}, :created_at, {:name => :updated_at}])
|
11
|
-
|
11
|
+
|
12
12
|
form.fields_from_config.keys.map(&:to_s).sort.should == %w(created_at first_name id last_name updated_at)
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
it "should set correct xtype for columns" do
|
16
16
|
form = Netzke::Basepack::FormPanel.new(:model => 'User', :items => [:first_name, :created_at, :role__name])
|
17
|
-
|
17
|
+
|
18
18
|
form.fields[:first_name][:xtype].should == :textfield
|
19
19
|
form.fields[:created_at][:xtype].should == :xdatetime
|
20
20
|
form.fields[:role__name][:xtype].should == :combobox
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
it "should set correct default field labels" do
|
24
24
|
form = Netzke::Basepack::FormPanel.new(:model => 'User', :items => [:first_name, :created_at, :role__name])
|
25
|
-
|
25
|
+
|
26
26
|
form.fields[:first_name][:field_label].should == "First name"
|
27
27
|
form.fields[:created_at][:field_label].should == "Created at"
|
28
28
|
form.fields[:role__name][:field_label].should == "Role name"
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
31
|
it "should set correct field values" do
|
32
32
|
role = Factory(:role, :name => "warrior")
|
33
33
|
user = Factory(:user, :first_name => "Carlos", :last_name => "Castaneda", :role => role)
|
34
|
-
|
34
|
+
|
35
35
|
form = Netzke::Basepack::FormPanel.new(:model => 'User', :record => user, :items => [:first_name, :last_name, :role__name])
|
36
|
-
|
36
|
+
|
37
37
|
form.fields[:first_name][:value].should == "Carlos"
|
38
38
|
form.fields[:last_name][:value].should == "Castaneda"
|
39
39
|
form.fields[:role__name][:value].should == "warrior"
|
40
40
|
end
|
41
|
-
|
41
|
+
|
42
42
|
it "should add primary key field automatically when omitted" do
|
43
43
|
form = Netzke::Basepack::FormPanel.new(:model => 'User', :items => [:first_name, :last_name, :role__name])
|
44
44
|
form.fields[:id].should_not be_nil
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
47
|
it "should pass normalized items to JS" do
|
48
48
|
form = Netzke::Basepack::FormPanel.new(:model => 'User', :items => [
|
49
49
|
{:xtype => 'fieldset', :items => [
|
50
|
-
:first_name,
|
50
|
+
:first_name,
|
51
51
|
{:name => "last_name"}
|
52
52
|
]},
|
53
53
|
:created_at,
|
@@ -60,11 +60,5 @@ describe Netzke::Basepack::FormPanel do
|
|
60
60
|
form.items[2][:name].should == "created_at"
|
61
61
|
form.items[3][:name].should == "updated_at"
|
62
62
|
end
|
63
|
-
|
64
|
-
it "should detect association column" do
|
65
|
-
form = Netzke::Basepack::FormPanel.new(:model => 'User', :items => [:role_id])
|
66
|
-
|
67
|
-
form.items[1][:name].should == "role__name"
|
68
|
-
end
|
69
|
-
|
63
|
+
|
70
64
|
end
|
data/test/rails_app/Gemfile
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
source 'http://rubygems.org'
|
2
2
|
|
3
|
-
gem 'rails', '3.0.
|
3
|
+
gem 'rails', '3.0.1'
|
4
4
|
|
5
|
-
gem 'netzke-core'
|
5
|
+
gem 'netzke-core'#, :git => "~/code/netzke/netzke-core"
|
6
|
+
gem 'netzke-persistence'#, :git => "~/code/netzke/netzke-persistence"
|
6
7
|
|
7
8
|
gem 'will_paginate', '3.0.pre2'
|
8
9
|
gem 'meta_where'
|
@@ -28,5 +29,5 @@ end
|
|
28
29
|
group :test do
|
29
30
|
gem 'sqlite3-ruby', :require => 'sqlite3'
|
30
31
|
gem 'pickle'
|
31
|
-
gem 'database_cleaner'
|
32
|
+
gem 'database_cleaner'#, :git => 'http://github.com/bmabey/database_cleaner.git'
|
32
33
|
end
|
data/test/rails_app/Gemfile.lock
CHANGED
@@ -1,27 +1,13 @@
|
|
1
|
-
GIT
|
2
|
-
remote: git@github.com:skozlov/netzke-core.git
|
3
|
-
revision: b3ffaf6
|
4
|
-
branch: rails3
|
5
|
-
specs:
|
6
|
-
netzke-core (0.6.0.beta)
|
7
|
-
activesupport (>= 3.0.0)
|
8
|
-
|
9
|
-
GIT
|
10
|
-
remote: http://github.com/bmabey/database_cleaner.git
|
11
|
-
revision: 474b226
|
12
|
-
specs:
|
13
|
-
database_cleaner (0.6.0.rc.3)
|
14
|
-
|
15
1
|
GEM
|
16
2
|
remote: http://rubygems.org/
|
17
3
|
specs:
|
18
4
|
abstract (1.0.0)
|
19
|
-
actionmailer (3.0.
|
20
|
-
actionpack (= 3.0.
|
5
|
+
actionmailer (3.0.1)
|
6
|
+
actionpack (= 3.0.1)
|
21
7
|
mail (~> 2.2.5)
|
22
|
-
actionpack (3.0.
|
23
|
-
activemodel (= 3.0.
|
24
|
-
activesupport (= 3.0.
|
8
|
+
actionpack (3.0.1)
|
9
|
+
activemodel (= 3.0.1)
|
10
|
+
activesupport (= 3.0.1)
|
25
11
|
builder (~> 2.1.2)
|
26
12
|
erubis (~> 2.6.6)
|
27
13
|
i18n (~> 0.4.1)
|
@@ -29,19 +15,19 @@ GEM
|
|
29
15
|
rack-mount (~> 0.6.12)
|
30
16
|
rack-test (~> 0.5.4)
|
31
17
|
tzinfo (~> 0.3.23)
|
32
|
-
activemodel (3.0.
|
33
|
-
activesupport (= 3.0.
|
18
|
+
activemodel (3.0.1)
|
19
|
+
activesupport (= 3.0.1)
|
34
20
|
builder (~> 2.1.2)
|
35
21
|
i18n (~> 0.4.1)
|
36
|
-
activerecord (3.0.
|
37
|
-
activemodel (= 3.0.
|
38
|
-
activesupport (= 3.0.
|
22
|
+
activerecord (3.0.1)
|
23
|
+
activemodel (= 3.0.1)
|
24
|
+
activesupport (= 3.0.1)
|
39
25
|
arel (~> 1.0.0)
|
40
26
|
tzinfo (~> 0.3.23)
|
41
|
-
activeresource (3.0.
|
42
|
-
activemodel (= 3.0.
|
43
|
-
activesupport (= 3.0.
|
44
|
-
activesupport (3.0.
|
27
|
+
activeresource (3.0.1)
|
28
|
+
activemodel (= 3.0.1)
|
29
|
+
activesupport (= 3.0.1)
|
30
|
+
activesupport (3.0.1)
|
45
31
|
acts_as_list (0.1.2)
|
46
32
|
arel (1.0.1)
|
47
33
|
activesupport (~> 3.0.0)
|
@@ -59,15 +45,16 @@ GEM
|
|
59
45
|
childprocess (0.1.3)
|
60
46
|
ffi (~> 0.6.3)
|
61
47
|
configuration (1.1.0)
|
62
|
-
cucumber (0.9.
|
48
|
+
cucumber (0.9.3)
|
63
49
|
builder (~> 2.1.2)
|
64
50
|
diff-lcs (~> 1.1.2)
|
65
|
-
gherkin (~> 2.2.
|
51
|
+
gherkin (~> 2.2.9)
|
66
52
|
json (~> 1.4.6)
|
67
53
|
term-ansicolor (~> 1.0.5)
|
68
54
|
cucumber-rails (0.3.2)
|
69
55
|
cucumber (>= 0.8.0)
|
70
56
|
culerity (0.2.12)
|
57
|
+
database_cleaner (0.6.0)
|
71
58
|
diff-lcs (1.1.2)
|
72
59
|
erubis (2.6.6)
|
73
60
|
abstract (>= 1.0.0)
|
@@ -77,24 +64,28 @@ GEM
|
|
77
64
|
gherkin (2.2.9)
|
78
65
|
json (~> 1.4.6)
|
79
66
|
term-ansicolor (~> 1.0.5)
|
80
|
-
i18n (0.4.
|
67
|
+
i18n (0.4.2)
|
81
68
|
json (1.4.6)
|
82
69
|
json_pure (1.4.6)
|
83
70
|
launchy (0.3.7)
|
84
71
|
configuration (>= 0.0.5)
|
85
72
|
rake (>= 0.8.1)
|
86
|
-
mail (2.2.
|
73
|
+
mail (2.2.9)
|
87
74
|
activesupport (>= 2.3.6)
|
88
|
-
|
89
|
-
|
75
|
+
i18n (~> 0.4.1)
|
76
|
+
mime-types (~> 1.16)
|
77
|
+
treetop (~> 1.4.8)
|
90
78
|
meta_where (0.9.6)
|
91
79
|
activerecord (~> 3.0.0)
|
92
80
|
activesupport (~> 3.0.0)
|
93
81
|
arel (~> 1.0.1)
|
94
82
|
mime-types (1.16)
|
95
83
|
mysql2 (0.2.6)
|
84
|
+
netzke-core (0.6.4)
|
85
|
+
activesupport (>= 3.0.1)
|
86
|
+
netzke-persistence (0.0.1)
|
96
87
|
nokogiri (1.4.3.1)
|
97
|
-
pickle (0.4.
|
88
|
+
pickle (0.4.3)
|
98
89
|
cucumber (>= 0.8)
|
99
90
|
rake
|
100
91
|
rspec (>= 1.3)
|
@@ -105,17 +96,17 @@ GEM
|
|
105
96
|
rack (>= 1.0.0)
|
106
97
|
rack-test (0.5.6)
|
107
98
|
rack (>= 1.0)
|
108
|
-
rails (3.0.
|
109
|
-
actionmailer (= 3.0.
|
110
|
-
actionpack (= 3.0.
|
111
|
-
activerecord (= 3.0.
|
112
|
-
activeresource (= 3.0.
|
113
|
-
activesupport (= 3.0.
|
99
|
+
rails (3.0.1)
|
100
|
+
actionmailer (= 3.0.1)
|
101
|
+
actionpack (= 3.0.1)
|
102
|
+
activerecord (= 3.0.1)
|
103
|
+
activeresource (= 3.0.1)
|
104
|
+
activesupport (= 3.0.1)
|
114
105
|
bundler (~> 1.0.0)
|
115
|
-
railties (= 3.0.
|
116
|
-
railties (3.0.
|
117
|
-
actionpack (= 3.0.
|
118
|
-
activesupport (= 3.0.
|
106
|
+
railties (= 3.0.1)
|
107
|
+
railties (3.0.1)
|
108
|
+
actionpack (= 3.0.1)
|
109
|
+
activesupport (= 3.0.1)
|
119
110
|
rake (>= 0.8.4)
|
120
111
|
thor (~> 0.14.0)
|
121
112
|
rake (0.8.7)
|
@@ -138,9 +129,9 @@ GEM
|
|
138
129
|
json_pure
|
139
130
|
rubyzip
|
140
131
|
spork (0.8.4)
|
141
|
-
sqlite3-ruby (1.3.
|
132
|
+
sqlite3-ruby (1.3.2)
|
142
133
|
term-ansicolor (1.0.5)
|
143
|
-
thor (0.14.
|
134
|
+
thor (0.14.4)
|
144
135
|
treetop (1.4.8)
|
145
136
|
polyglot (>= 0.3.1)
|
146
137
|
tzinfo (0.3.23)
|
@@ -157,14 +148,15 @@ DEPENDENCIES
|
|
157
148
|
capybara
|
158
149
|
cucumber
|
159
150
|
cucumber-rails
|
160
|
-
database_cleaner
|
151
|
+
database_cleaner
|
161
152
|
factory_girl
|
162
153
|
launchy
|
163
154
|
meta_where
|
164
155
|
mysql2
|
165
|
-
netzke-core
|
156
|
+
netzke-core
|
157
|
+
netzke-persistence
|
166
158
|
pickle
|
167
|
-
rails (= 3.0.
|
159
|
+
rails (= 3.0.1)
|
168
160
|
rspec-rails (~> 2.0.0)
|
169
161
|
spork
|
170
162
|
sqlite3-ruby
|
@@ -2,15 +2,15 @@ class SimpleBasicApp < Netzke::Basepack::BasicApp
|
|
2
2
|
def menu
|
3
3
|
[:simple_accordion.action, :user_grid.action, :simple_tab_panel.action] + super
|
4
4
|
end
|
5
|
-
|
5
|
+
|
6
6
|
action :simple_accordion, :icon => :application_tile_vertical, :handler => :load_component_by_action
|
7
7
|
action :user_grid, :icon => :table, :handler => :load_component_by_action
|
8
8
|
action :simple_tab_panel, :icon => :table_multiple, :handler => :load_component_by_action
|
9
|
-
|
9
|
+
|
10
10
|
component :user_grid
|
11
11
|
component :simple_accordion
|
12
12
|
component :simple_tab_panel, :active_tab => 0
|
13
|
-
|
13
|
+
|
14
14
|
# Wrapping up original layout into a border-layout with the north panel being a fancy header
|
15
15
|
def final_config
|
16
16
|
orig = super
|
@@ -1,24 +1,25 @@
|
|
1
1
|
class SomeBorderLayout < Netzke::Basepack::BorderLayoutPanel
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
end
|
2
|
+
config :items => [
|
3
|
+
{:title => "Who", :class_name => "Basepack::GridPanel", :region => :center, :model => "User", :name => :user_grid},
|
4
|
+
{:title => "Item Two", :class_name => "Basepack::GridPanel", :region => :west, :width => 500, :split => true, :collapsible => true, :model => "Role", :name => :role_grid}
|
5
|
+
],
|
6
|
+
:bbar => [:update_center_region.action, :update_west_region.action]
|
7
|
+
|
8
|
+
action :update_center_region
|
9
|
+
action :update_west_region
|
11
10
|
|
11
|
+
# config :default, :persistence => true
|
12
|
+
|
12
13
|
js_method :on_update_west_region, <<-JS
|
13
14
|
function(){
|
14
15
|
this.getChildComponent('user_grid').body.update('Updated West Region Content');
|
15
16
|
}
|
16
17
|
JS
|
17
|
-
|
18
|
+
|
18
19
|
js_method :on_update_center_region, <<-JS
|
19
20
|
function(){
|
20
21
|
this.getChildComponent('role_grid').body.update('Updated Center Region Content');
|
21
22
|
}
|
22
23
|
JS
|
23
|
-
|
24
|
+
|
24
25
|
end
|
@@ -9,9 +9,9 @@ class SomeSearchPanel < Netzke::Basepack::FormPanel
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def normalize_field(f)
|
12
|
-
f = if f.is_a?(Symbol) || f.is_a?(String)
|
12
|
+
f = if f.is_a?(Symbol) || f.is_a?(String)
|
13
13
|
{:name => f.to_s, :operator => default_operator}
|
14
|
-
else
|
14
|
+
else
|
15
15
|
search_condition = f[:name]
|
16
16
|
if search_condition.is_a?(MetaWhere::Column)
|
17
17
|
{:name => search_condition.column, :operator => search_condition.method}
|
@@ -19,14 +19,14 @@ class SomeSearchPanel < Netzke::Basepack::FormPanel
|
|
19
19
|
{:name => search_condition.to_s, :operator => default_operator}
|
20
20
|
end
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
f[:disabled] = primary_key_attr?(f)
|
24
|
-
|
24
|
+
|
25
25
|
f = super(f)
|
26
26
|
|
27
27
|
f.merge(:name => [f[:name], "__", f[:operator]].join)
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
private
|
31
31
|
def default_operator
|
32
32
|
"gt"
|