netzke-basepack 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/CHANGELOG.rdoc +197 -183
- data/LICENSE +1 -3
- data/README.rdoc +10 -6
- data/TODO.rdoc +5 -2
- data/VERSION +1 -1
- data/javascripts/basepack.js +20 -10
- data/lib/app/models/netzke_auto_column.rb +1 -1
- data/lib/netzke/basic_app.rb +16 -2
- data/lib/netzke/basic_app_extras/statusbar_ext.js +8 -0
- data/lib/netzke/border_layout_panel.rb +1 -1
- data/lib/netzke/ext.rb +1 -0
- data/lib/netzke/fields_configurator.rb +3 -5
- data/lib/netzke/form_panel.rb +15 -11
- data/lib/netzke/form_panel_js.rb +1 -8
- data/lib/netzke/grid_panel.rb +61 -61
- data/lib/netzke/grid_panel_api.rb +2 -2
- data/lib/netzke/grid_panel_js.rb +200 -177
- data/lib/netzke/plugins/configuration_tool.rb +2 -2
- data/lib/netzke/property_editor.rb +22 -18
- data/lib/netzke/tree_panel.rb +6 -54
- data/stylesheets/basepack.css +5 -0
- data/test/unit/helper_model_test.rb +1 -1
- metadata +3 -4
- data/lib/netzke/grid_panel_extras/javascripts/check-column.js +0 -33
- data/netzke-basepack.gemspec +0 -170
data/.gitignore
CHANGED
data/CHANGELOG.rdoc
CHANGED
@@ -1,183 +1,197 @@
|
|
1
|
-
v0.5.
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
Fix:
|
10
|
-
Fix:
|
11
|
-
|
12
|
-
Fix:
|
13
|
-
Fix:
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
New:
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
New: BasicApp
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
v0.4.
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
New:
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
Fix:
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
v0.3.
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
v0.
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
Bug fix:
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
v0.
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
v0.
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
v0.1.
|
164
|
-
|
165
|
-
|
166
|
-
v0.1.
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
1
|
+
= v0.5.3 - 2009-10-12
|
2
|
+
* Compatibility with Ext 3.0 (and dropping compatibility with 2.x).
|
3
|
+
* Compatibility with netzke-core v0.4.4.
|
4
|
+
* Impr: Form/GridPanel-based widgets: more consistent Ext.Action-related functionality and code, like (context) menu, bbar, etc.
|
5
|
+
* Impr: GridPanel: <tt>rows_reordering_available</tt> is now true by default.
|
6
|
+
* Impr: TreePanel now sets "leaf" attribute to true if the node has no children.
|
7
|
+
* Impr: Grid/TreePanel now have persistent config enabled by default.
|
8
|
+
* Impr: if persistent_config is disabled, a widget won't be talking to the server in vain any more.
|
9
|
+
* Fix: GridPanel didn't fire row editing when the first column was a "checkbox" column.
|
10
|
+
* Fix: the GridPanel's <tt>:scopes</tt> parameter now correctly processes named scopes as strings inside the array, e.g.
|
11
|
+
:scopes => ["current", [:id_gt, 100]]
|
12
|
+
* Fix: on deleting records from GridPanel, <tt>destroy</tt> method is being called instead of <tt>delete</tt>.
|
13
|
+
* Fix: FieldsConfigurator made a little bit more stable.
|
14
|
+
* Fix: patching Ext's bug that caused double firing of "columnmove" in GridPanel.
|
15
|
+
* Fix: moving columns around in GridPanel was causing erroneous mapping of data to columns after data reload.
|
16
|
+
|
17
|
+
= v0.5.2 - 2009-09-24
|
18
|
+
* Fix: combobox options for association columns didn't work properly.
|
19
|
+
* Fix: GridPanel's multi-edit functionality didn't work.
|
20
|
+
* Fix: gem dependencies are now correct.
|
21
|
+
|
22
|
+
= v0.5.1 - 2009-09-11
|
23
|
+
* Fix: crash when FormPanel has no data_class_name specified.
|
24
|
+
* 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.
|
25
|
+
* Fix: DataAccessor widgets (Form/GridPanel) now don't crash when calculating default columns/fields for the underlying model that has polymorphic columns.
|
26
|
+
* Fix: TabPanel was sending redundant "tabchange" event to server when initially instantiated.
|
27
|
+
* Fix: column filters were making GridPanel crash when the column editor was set to "textarea".
|
28
|
+
* Fix: dongling comma and "delete" object properties caused problems in IE and Safari.
|
29
|
+
* Fix: a stand-alone TabPanel would not render the active item.
|
30
|
+
* New: BasicApp: masquerading as "World". In this mode all the "touched" persistent preferences will be overwritten for all roles and users.
|
31
|
+
* Impr: configuration panel's header now shows the underlying model's name for convenience.
|
32
|
+
* Fix: MasqueradeSelector widget added.
|
33
|
+
|
34
|
+
= v0.5.0 - 2009-09-06
|
35
|
+
* Major refactoring and code reorganization.
|
36
|
+
* Compatibility with netzke-core v0.4.0.
|
37
|
+
* New: GridPanel now supports adding/editing records in a form and extended configurable search.
|
38
|
+
* New: GridPanel now can be loaded along with initial data (saves a request to the server).
|
39
|
+
* New: context menu in GridPanel
|
40
|
+
* New: "scopes" configuration option added to GridPanel to specify the searchlogic-compatible scope for the data.
|
41
|
+
* New: "strong_default_attrs" config option added to GridPanel to specify the attributes that will be assigned to each record that is created or modified by the grid.
|
42
|
+
* Usability: GridPanel's actions now get enabled/disabled according to the current selection.
|
43
|
+
* Configuration panel for grids and forms now works more consistently.
|
44
|
+
* New: some smart defaults for column/fields in Grid/FormPanel.
|
45
|
+
* New: BasicApp supports masquerading and application-wide AJAX activity indicator.
|
46
|
+
|
47
|
+
= v0.4.2 - 2009-05-07
|
48
|
+
* Fix: afterlayout event bind removed completely because of some tricky inconsistent behavior of Ext. BasicApp initializing code put directly into js_after_constructor.
|
49
|
+
|
50
|
+
= v0.4.1 - 2009-05-07
|
51
|
+
* Fix: afterlayout call moved to js_after_constructor in BasicApp
|
52
|
+
* Fix: cleaner persistent_config handling
|
53
|
+
* New: default's configuration enabled for FormPanel on class-level
|
54
|
+
* Fix: differently configured forms on the same page were showing the same columns
|
55
|
+
* Fix: TableEditor was showing config-tool by default (must be hidden)
|
56
|
+
|
57
|
+
= v0.4.0 - 2009-05-07
|
58
|
+
* Refactor: got rid of NetzkeFormPanelField and NetzkeGridPanelColumn classes along with their tables. The layout is now stored in netzke_preferences.
|
59
|
+
* New: dynamic hiding of columns from column menu in GridPanel.
|
60
|
+
* New: FormPanel now supports combo boxes.
|
61
|
+
* Fix: config[:bbar] set to 'false' now works in grids with pagination
|
62
|
+
* New: you can specify :preloaded => true in a tab config in TabPanel to preload the widget in that tab along with the TabPanel itself
|
63
|
+
* New: hideBusy added to Ext.StatusBar
|
64
|
+
* Fix: assigning association (a Boss to a Clerk) by virtual column (like boss__name) works now
|
65
|
+
* Fix: an old bug that made GridPanel misbehave after reordering the columns
|
66
|
+
|
67
|
+
= v0.3.10
|
68
|
+
* BasicApp-based widgets can now introduce arbitrary layout, following the convention of defining "main-panel" and "main-toolbar" panels with layout 'fit'.
|
69
|
+
|
70
|
+
= v0.3.9.1
|
71
|
+
* Bug fix: (regression) appLoaded() in BasicApp gets executed again
|
72
|
+
|
73
|
+
= v0.3.9
|
74
|
+
* AccordionPanel tests added
|
75
|
+
* TabPanel works now
|
76
|
+
* AccordionPanel replaced with more intuitive TabPanel in the configuration window
|
77
|
+
* Code clean-up by using "single" option to call appLoaded() on "afterlayout"
|
78
|
+
* Table editor bug fix
|
79
|
+
|
80
|
+
= v0.3.8
|
81
|
+
* Fixing Ext's EditableItem render problem.
|
82
|
+
* Filters by default enabled again in GridPanel.
|
83
|
+
* GridPanel enhancement: base_params get sent along with post_data.
|
84
|
+
|
85
|
+
= v0.3.7
|
86
|
+
* Netzke-core version sync.
|
87
|
+
* Rails 2.3.2 compatibility.
|
88
|
+
|
89
|
+
= v0.3.6
|
90
|
+
* Netzke-core v0.2.9 compatibility.
|
91
|
+
* Cleaner handling of custom renderers in GridPanel.
|
92
|
+
* New FormPanel-based PropertyEditor replaces PropertyGrid.
|
93
|
+
* Xcheckbox and check-column introduced.
|
94
|
+
* TODO file added.
|
95
|
+
* Bug fix: in TableEditor, the grid now responses on events also after being reconfigured.
|
96
|
+
* Bug fix: a couple of IE-related bugs.
|
97
|
+
* Significant code clean-up.
|
98
|
+
|
99
|
+
= v0.3.5
|
100
|
+
* Netzke-core v0.2.8 compatibility.
|
101
|
+
|
102
|
+
= v0.3.4
|
103
|
+
* Quick tips added to the "tools".
|
104
|
+
* Regression: the "General" configuration panel for GridPanel works again.
|
105
|
+
* GridPanel: rows_per_page configuration is now read from General config panel.
|
106
|
+
|
107
|
+
= v0.3.3.1
|
108
|
+
* Obviously using "new" as a property name in JavaScript isn't liked by Safari. Fixed.
|
109
|
+
|
110
|
+
= v0.3.3
|
111
|
+
* Bug fix: application not loading the widget specified in the URL (Ext.History-related).
|
112
|
+
* Some code refactoring and readability improvements.
|
113
|
+
* Ext.componentCache renamed into Ext.netzke.cache.
|
114
|
+
* New widget: TableEditor (a compound widget containing a grid and a form for editing table data).
|
115
|
+
* BorderLayoutPanel: a function getRegionWidget(region) added to access a widget in the specified region.
|
116
|
+
* Bug fix: BasicApp: FeedbackGhost now gets instantiated before BasicApp.
|
117
|
+
* Clearer handling of requests to non-existing aggregatees.
|
118
|
+
* Bug fix: now Ext 2.2.1 compatible.
|
119
|
+
* Column operations are now handled properly when :persistent_layout is set to false.
|
120
|
+
* Grid/Form fields configuration is extended with "ext_config" field which stores (in JSON-format) all the extra configuration, which gives extra flexibility to individual column/field configuration.
|
121
|
+
* :persistent_layout set to false now makes a widget ignore what's in the DB.
|
122
|
+
* Bug fix: AccordionPanel doesn't crash when no active item is specified.
|
123
|
+
* Bug fix: redundant flash messages for GridPanel.
|
124
|
+
* FeedbackGhost won't be showing anything if given an empty array.
|
125
|
+
* Cleaner handling of validations in GridPanel.
|
126
|
+
* FormPanel ready for the demo.
|
127
|
+
|
128
|
+
= v0.3.2
|
129
|
+
* Minor code restructuring.
|
130
|
+
* Working on FormPanel cont'd.
|
131
|
+
|
132
|
+
= v0.3.1
|
133
|
+
* Added the "conditions" configuration option to GridPanel to limit the search
|
134
|
+
* Basic column editor for grids has been replaced with FieldsConfigurator, which can do a bit more
|
135
|
+
* Added Checkbox column/form-field type for boolean fields
|
136
|
+
* "renderer" configuration option added for grid columns - any Ext.util.Format renderer can be specified there (thanks to Josh Holt for the initial idea)
|
137
|
+
|
138
|
+
= v0.3.0
|
139
|
+
* Added BasicApp widget - the base for a Ext.Viewport based ("application") widget with support for dynamic widget loading, browser history, authentification, and more. See the demo an http://netzke-demo.writelesscode.com
|
140
|
+
|
141
|
+
= v0.2.2
|
142
|
+
* Meta: updated netzke-core version (dependency)
|
143
|
+
|
144
|
+
= v0.2.1
|
145
|
+
* Regression: BorderLayoutPanel now restores the region sizes from the database
|
146
|
+
|
147
|
+
= v0.2.0.1
|
148
|
+
* Meta: updated netzke-core version (dependency)
|
149
|
+
|
150
|
+
= v0.2.0
|
151
|
+
* Some re-factoring and redesign along with netzke-core
|
152
|
+
* Panel widget added
|
153
|
+
* BorderLayoutPanel added
|
154
|
+
* AccordionPanel added
|
155
|
+
* Bug fix: column operations configuration misbehaving
|
156
|
+
* Renamed Grid into GridPanel
|
157
|
+
* Bug fix: exception was thrown at a column operation when no layout_manager was present
|
158
|
+
* Reworked permission handling in GridPanel.
|
159
|
+
|
160
|
+
= v0.1.4.1
|
161
|
+
* Meta: updated netzke-core version (dependency)
|
162
|
+
|
163
|
+
= v0.1.4
|
164
|
+
* Grid#get_columns provides default columns even if none of layout_manager_class & column_manager_class are available
|
165
|
+
|
166
|
+
= v0.1.3.1
|
167
|
+
* Meta: updated netzke-core version (dependency)
|
168
|
+
|
169
|
+
= v0.1.3
|
170
|
+
* Path to javascript for grid filters corrected
|
171
|
+
* Bug with creating new records in the grid fixed
|
172
|
+
* Optimized away redundant sql queries when calling Grid#get_columns (sort of memoization)
|
173
|
+
* README updated
|
174
|
+
|
175
|
+
= v0.1.2.1
|
176
|
+
* Meta: trying to succeed publishing on RubyForge
|
177
|
+
|
178
|
+
= v0.1.2
|
179
|
+
* Updated README with an example of stand-alone widget usage
|
180
|
+
* Meta: updated netzke-core version (dependency)
|
181
|
+
|
182
|
+
= v0.1.1.2
|
183
|
+
* Meta: updated netzke-core version (dependency)
|
184
|
+
|
185
|
+
= v0.1.1.1
|
186
|
+
* Meta: github gem naming convention
|
187
|
+
|
188
|
+
= v0.1.1
|
189
|
+
* Cleaner exception handling while loading data to grid
|
190
|
+
* Column resize & move functionality enabled by default
|
191
|
+
* Column filters added
|
192
|
+
|
193
|
+
= v0.1.0.1
|
194
|
+
* Meta work: replacing underscore with dash in the name
|
195
|
+
|
196
|
+
= v0.1.0 - 2008-12-20
|
197
|
+
* Initial release
|
data/LICENSE
CHANGED
data/README.rdoc
CHANGED
@@ -1,22 +1,26 @@
|
|
1
1
|
= netzke-basepack
|
2
|
-
A pack of basic Rails/ExtJS widgets as a part of the Netzke framework. Live demo/tutorials on http://blog.writelesscode.com. Introduction to the Netzke framework: http://github.com/skozlov/netzke
|
2
|
+
A pack of basic Rails/ExtJS widgets as a part of the Netzke framework. Live demo/tutorials on http://blog.writelesscode.com. Introduction to the Netzke framework and the Wiki: http://github.com/skozlov/netzke
|
3
3
|
|
4
4
|
Note that if you would like to modify this code or experiment with it, you may be better off cloning this project into your app's vendor/plugin directory - it will then behave as a Rails plugin.
|
5
5
|
|
6
6
|
= Prerequisites
|
7
7
|
1. Rails >= 2.2
|
8
|
-
2. Ext JS >=
|
9
|
-
cd public && ln -s ~/Developer/extjs/ext-
|
8
|
+
2. Ext JS >= 3.0: its root *must* be accessible as RAILS_ROOT/public/extjs. You may symlink your Ext JS library here like this (from your app folder):
|
9
|
+
cd public && ln -s ~/Developer/extjs/ext-3.0 extjs
|
10
10
|
|
11
11
|
3. acts_as_list plugin must be installed:
|
12
12
|
./script/plugin install git://github.com/rails/acts_as_list.git
|
13
13
|
|
14
|
+
4. mislav-will_paginate >= 2.3.0
|
15
|
+
gem sources -a http://gems.github.com/
|
16
|
+
sudo gem install mislav-will_paginate
|
17
|
+
|
14
18
|
= Installation
|
15
|
-
Install
|
16
|
-
gem install
|
19
|
+
Install Netzke gems:
|
20
|
+
gem install netzke-basepack
|
17
21
|
|
18
22
|
Include it into environment.rb:
|
19
|
-
config.gem "
|
23
|
+
config.gem "netzke-basepack"
|
20
24
|
|
21
25
|
Include mapping for Netzke controller providing *.js and *.css (in routes.rb):
|
22
26
|
map.netzke
|
data/TODO.rdoc
CHANGED
@@ -2,7 +2,10 @@
|
|
2
2
|
* Make column/fields configuration fool-proof
|
3
3
|
* Introduce three-state checkbox for SearchPanel
|
4
4
|
* Add icons to buttons to actions (toolbars/menus)
|
5
|
+
* On grid refresh, reset the dirty fields, so that the "Apply" button doesn't do anything
|
6
|
+
|
7
|
+
== Optimizations
|
8
|
+
* Add indexes into tables
|
5
9
|
|
6
10
|
== One day
|
7
|
-
*
|
8
|
-
* Replace xcheckbox with checkbox in FormPanel
|
11
|
+
* Replace xcheckbox with checkbox in FormPanel
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.3
|
data/javascripts/basepack.js
CHANGED
@@ -96,15 +96,6 @@ Ext.netzke.filterMap = {
|
|
96
96
|
datefield:'Date'
|
97
97
|
};
|
98
98
|
|
99
|
-
Ext.override(Ext.StatusBar, {
|
100
|
-
hideBusy : function(){
|
101
|
-
return this.setStatus({
|
102
|
-
text: this.defaultText,
|
103
|
-
iconCls: this.defaultIconCls
|
104
|
-
});
|
105
|
-
}
|
106
|
-
});
|
107
|
-
|
108
99
|
Ext.data.RecordArrayReader = Ext.extend(Ext.data.JsonReader, {
|
109
100
|
/**
|
110
101
|
* Create a data block containing Ext.data.Records from an Array.
|
@@ -784,4 +775,23 @@ Ext.ux.form.DateTime = Ext.extend(Ext.form.Field, {
|
|
784
775
|
Ext.reg('xdatetime', Ext.ux.form.DateTime);
|
785
776
|
|
786
777
|
// eof
|
787
|
-
|
778
|
+
Ext.grid.HeaderDropZone.prototype.onNodeDrop = function(n, dd, e, data){
|
779
|
+
var h = data.header;
|
780
|
+
if(h != n){
|
781
|
+
var cm = this.grid.colModel;
|
782
|
+
var x = Ext.lib.Event.getPageX(e);
|
783
|
+
var r = Ext.lib.Dom.getRegion(n.firstChild);
|
784
|
+
var pt = (r.right - x) <= ((r.right-r.left)/2) ? "after" : "before";
|
785
|
+
var oldIndex = this.view.getCellIndex(h);
|
786
|
+
var newIndex = this.view.getCellIndex(n);
|
787
|
+
if(pt == "after"){
|
788
|
+
newIndex++;
|
789
|
+
}
|
790
|
+
if(oldIndex < newIndex){
|
791
|
+
newIndex--;
|
792
|
+
}
|
793
|
+
cm.moveColumn(oldIndex, newIndex);
|
794
|
+
return true;
|
795
|
+
}
|
796
|
+
return false;
|
797
|
+
}
|