skozlov-netzke-basepack 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +5 -0
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/lib/netzke/active_record/basepack.rb +3 -3
- data/lib/netzke/grid_panel_api.rb +4 -6
- data/lib/netzke/grid_panel_js.rb +11 -7
- data/netzke-basepack.gemspec +3 -3
- metadata +4 -3
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
v0.5.2 - 2009-09-24
|
2
|
+
Fix: combobox options for association columns didn't work properly.
|
3
|
+
Fix: GridPanel's multi-edit functionality didn't work.
|
4
|
+
Fix: gem dependencies are now correct.
|
5
|
+
|
1
6
|
v0.5.1 - 2009-09-11
|
2
7
|
Fix: crash when FormPanel has no data_class_name specified.
|
3
8
|
New: DataAccessor widgets (Form/GridPanel) now let the underlying model know which widget (i.e. which instance) accesses its data. Can be useful in virtual attributes for generating widget-specific HTML.
|
data/Rakefile
CHANGED
@@ -8,8 +8,8 @@ begin
|
|
8
8
|
gemspec.homepage = "http://github.com/skozlov/netzke-basepack"
|
9
9
|
gemspec.rubyforge_project = "netzke-basepack"
|
10
10
|
gemspec.authors = ["Sergei Kozlov"]
|
11
|
-
gemspec.add_dependency
|
12
|
-
gemspec.add_dependency
|
11
|
+
gemspec.add_dependency("netzke-core", ">=0.4.3")
|
12
|
+
gemspec.add_dependency("searchlogic", ">=2.0.0")
|
13
13
|
end
|
14
14
|
Jeweler::RubyforgeTasks.new do |rubyforge|
|
15
15
|
rubyforge.doc_task = "rdoc"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.2
|
@@ -62,7 +62,7 @@ module Netzke::ActiveRecord
|
|
62
62
|
|
63
63
|
module ClassMethods
|
64
64
|
|
65
|
-
def options_for(column, query =
|
65
|
+
def options_for(column, query = "")
|
66
66
|
# First, check if we have options for this class and column defined in persistent storage
|
67
67
|
NetzkePreference.widget_name = self.name
|
68
68
|
options = NetzkePreference[:combobox_options] || {}
|
@@ -82,12 +82,12 @@ module Netzke::ActiveRecord
|
|
82
82
|
column = assoc_name
|
83
83
|
if self.column_names.include?(column)
|
84
84
|
# it's simply a column in the table
|
85
|
-
records = query.
|
85
|
+
records = query.empty? ? find_by_sql("select distinct #{column} from #{table_name}") : find_by_sql("select distinct #{column} from #{table_name} where #{column} like '#{query}%'")
|
86
86
|
records.map{|r| r.send(column)}
|
87
87
|
else
|
88
88
|
# it's a "virtual" column - the least effective search
|
89
89
|
records = self.find(:all).map{|r| r.send(column)}.uniq
|
90
|
-
query.
|
90
|
+
query.empty? ? records : records.select{|r| r.index(/^#{query}/)}
|
91
91
|
end
|
92
92
|
end
|
93
93
|
end
|
@@ -69,7 +69,6 @@ module Netzke
|
|
69
69
|
def get_combobox_options(params)
|
70
70
|
column = params[:column]
|
71
71
|
query = params[:query]
|
72
|
-
|
73
72
|
{:data => config[:data_class_name].constantize.options_for(column, query).map{|s| [s]}}
|
74
73
|
end
|
75
74
|
|
@@ -227,11 +226,11 @@ module Netzke
|
|
227
226
|
|
228
227
|
# When providing the edit_form aggregatee, fill in the form with the requested record
|
229
228
|
def load_aggregatee_with_cache(params)
|
230
|
-
if params[:id] == '
|
231
|
-
|
232
|
-
else
|
233
|
-
super
|
229
|
+
if params[:id] == 'editForm'
|
230
|
+
aggregatees[:edit_form].merge!(:record_id => params[:record_id])
|
234
231
|
end
|
232
|
+
|
233
|
+
super
|
235
234
|
end
|
236
235
|
|
237
236
|
# Search scopes, in searchlogic format
|
@@ -347,6 +346,5 @@ module Netzke
|
|
347
346
|
res.to_nifty_json
|
348
347
|
end
|
349
348
|
|
350
|
-
|
351
349
|
end
|
352
350
|
end
|
data/lib/netzke/grid_panel_js.rb
CHANGED
@@ -581,12 +581,14 @@ module Netzke
|
|
581
581
|
this.editFormWindow.show(null, function(){
|
582
582
|
var selModel = this.getSelectionModel();
|
583
583
|
if (selModel.getCount() > 1) {
|
584
|
-
|
584
|
+
|
585
585
|
// multiedit
|
586
|
+
this.editFormWindow.setTitle('Multi-edit');
|
586
587
|
this.loadAggregatee({
|
587
|
-
id: "
|
588
|
+
id: "multiEditForm",
|
588
589
|
container: this.editFormWindow.id,
|
589
590
|
callback: function(aggr){
|
591
|
+
// on apply attach ids of selected rows
|
590
592
|
aggr.on('apply', function(){
|
591
593
|
var ids = [];
|
592
594
|
selModel.each(function(r){
|
@@ -598,14 +600,16 @@ module Netzke
|
|
598
600
|
scope: this
|
599
601
|
});
|
600
602
|
} else {
|
603
|
+
|
601
604
|
// single edit
|
602
605
|
this.editFormWindow.setTitle('Edit');
|
603
606
|
var recordId = selModel.getSelected().get('id');
|
604
607
|
this.loadAggregatee({
|
605
|
-
id: "
|
608
|
+
id: "editForm",
|
606
609
|
container: this.editFormWindow.id,
|
607
|
-
|
608
|
-
|
610
|
+
params: {
|
611
|
+
record_id: recordId
|
612
|
+
}
|
609
613
|
});
|
610
614
|
}
|
611
615
|
}, this);
|
@@ -640,7 +644,7 @@ module Netzke
|
|
640
644
|
this.formWindow.show(null, function(){
|
641
645
|
this.formWindow.closeRes = 'cancel';
|
642
646
|
if (!this.formWindow.getWidget()){
|
643
|
-
this.loadAggregatee({id:"
|
647
|
+
this.loadAggregatee({id:"newRecordForm", container:this.formWindow.id});
|
644
648
|
}
|
645
649
|
}, this);
|
646
650
|
|
@@ -704,7 +708,7 @@ module Netzke
|
|
704
708
|
this.searchWindow.show(null, function(){
|
705
709
|
this.searchWindow.closeRes = 'cancel';
|
706
710
|
if (!this.searchWindow.getWidget()){
|
707
|
-
this.loadAggregatee({id:"
|
711
|
+
this.loadAggregatee({id:"searchPanel", container:this.searchWindow.id});
|
708
712
|
}
|
709
713
|
}, this);
|
710
714
|
|
data/netzke-basepack.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{netzke-basepack}
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Sergei Kozlov"]
|
12
|
-
s.date = %q{2009-09-
|
12
|
+
s.date = %q{2009-09-24}
|
13
13
|
s.description = %q{Pre-built Netzke widgets for your RIA}
|
14
14
|
s.email = %q{sergei@playcode.nl}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -113,7 +113,7 @@ Gem::Specification.new do |s|
|
|
113
113
|
s.rdoc_options = ["--charset=UTF-8"]
|
114
114
|
s.require_paths = ["lib"]
|
115
115
|
s.rubyforge_project = %q{netzke-basepack}
|
116
|
-
s.rubygems_version = %q{1.3.
|
116
|
+
s.rubygems_version = %q{1.3.5}
|
117
117
|
s.summary = %q{Pre-built Netzke widgets for your RIA}
|
118
118
|
s.test_files = [
|
119
119
|
"test/app_root/app/controllers/application.rb",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skozlov-netzke-basepack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergei Kozlov
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-09-
|
12
|
+
date: 2009-09-24 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- uninstall.rb
|
136
136
|
has_rdoc: false
|
137
137
|
homepage: http://github.com/skozlov/netzke-basepack
|
138
|
+
licenses:
|
138
139
|
post_install_message:
|
139
140
|
rdoc_options:
|
140
141
|
- --charset=UTF-8
|
@@ -155,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
156
|
requirements: []
|
156
157
|
|
157
158
|
rubyforge_project: netzke-basepack
|
158
|
-
rubygems_version: 1.
|
159
|
+
rubygems_version: 1.3.5
|
159
160
|
signing_key:
|
160
161
|
specification_version: 3
|
161
162
|
summary: Pre-built Netzke widgets for your RIA
|