netzke-basepack 0.11.2 → 0.12.0.beta
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +543 -9
- data/javascripts/basepack.js +14 -0
- data/javascripts/netzkeremotecombo.js +4 -4
- data/lib/netzke-basepack.rb +0 -6
- data/lib/netzke/basepack/columns.rb +2 -0
- data/lib/netzke/basepack/data_adapters/active_record_adapter.rb +28 -25
- data/lib/netzke/basepack/form.rb +1 -1
- data/lib/netzke/basepack/form/javascripts/form.js +0 -3
- data/lib/netzke/basepack/grid.rb +0 -13
- data/lib/netzke/basepack/grid/javascripts/event_handling.js +1 -1
- data/lib/netzke/basepack/grid/javascripts/extensions.js +20 -21
- data/lib/netzke/basepack/grid/javascripts/grid.js +24 -39
- data/lib/netzke/basepack/grid/services.rb +2 -3
- data/lib/netzke/basepack/query_builder/javascripts/query_builder.js +0 -2
- data/lib/netzke/basepack/search_panel.rb +5 -7
- data/lib/netzke/basepack/search_panel/javascripts/condition_field.js +0 -2
- data/lib/netzke/basepack/version.rb +1 -1
- data/netzke-basepack.gemspec +1 -1
- metadata +4 -6
- data/lib/netzke/basepack/form/javascripts/comma_list_cbg.js +0 -50
- data/lib/netzke/basepack/form/javascripts/n_radio_group.js +0 -42
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85ed177b26ec3cc46b9a5a1606117072bcdcc146
|
4
|
+
data.tar.gz: 2aa3f06ae50956fe74c668a9e4e020a145e318e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41640719dcc8209666ba2c5ea6f76a2609ddd77e76455b365b53cfd80895fa560fe428f58925e3bc23b91821daa1671236357da4174aaf13da2998cc3410e73b
|
7
|
+
data.tar.gz: 74fb7310e03390c8522e10c58fb2faa57c52a888ebbfd40fecee2a985067ed47059128e8b2c7bd52dec93e981cda64b7fe6e78cedeee20f8a49e6db95adbb9bf
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,546 @@
|
|
1
|
-
# 0.11.2 - 2015-05-01
|
2
|
-
* Fix timezone-related display bug: https://github.com/netzke/netzke-basepack/pull/160
|
3
|
-
|
4
|
-
# 0.11.1 - 2015-04-20
|
5
|
-
* Fix filtering by association when associtaion method is integer
|
6
|
-
* Fix decimal and float columns in extended search form
|
7
|
-
* Fix showing 0-value in association shown by integer
|
8
|
-
* Fix limited precision in numeric column filter
|
9
|
-
|
10
1
|
# 0.11.0 - 2015-02-05
|
11
2
|
* Rails 4.2
|
12
3
|
* A few fixes from AlexKovynev
|
4
|
+
|
5
|
+
# 0.10.1 - 2014-06-04
|
6
|
+
* Fix Core dependency version
|
7
|
+
|
8
|
+
# 0.10.0 - 2014-04-02
|
9
|
+
* Rails 4
|
10
|
+
|
11
|
+
# 0.9.0 - 2014-02-08
|
12
|
+
* Ext JS 4.2.0
|
13
|
+
* new
|
14
|
+
* GridLiveSearch plugin - implements flexible "live" search on any grid
|
15
|
+
* Implement multi-sorting support in grids
|
16
|
+
* internal changes
|
17
|
+
* Endpoints renamed in Grid:
|
18
|
+
* `post_data` => `server_create` and `server_update`
|
19
|
+
* `get_data` => `server_read`
|
20
|
+
* `delete_data` => `server_delete`
|
21
|
+
* SECURITY FIX
|
22
|
+
* when a grid had a scope set, it was possible to delete/edit a record outside of the scope by tweaking its id during
|
23
|
+
request
|
24
|
+
* bug fix
|
25
|
+
* datetime field in forms respects `read_only` now
|
26
|
+
* Re-enable piggybacking commands to the client from within Grid's `get_data` endpoint
|
27
|
+
* Searching and filtering in grid by date/datetime columns is fixed
|
28
|
+
* Unchecked checkbox in form gets saved as false now (not nil)
|
29
|
+
* improvements
|
30
|
+
* Raise a meaningful exception when a model doesn't have a primary key, which is required by Grid
|
31
|
+
* Do not let rows in grid disappear after an attempt to create invalid records
|
32
|
+
|
33
|
+
# 0.8.3 - 2013-04-24
|
34
|
+
* improvements
|
35
|
+
* implement advanced searching by association (issue #93)
|
36
|
+
* a few improvements on grid column filtering (by Simon Willmann)
|
37
|
+
* bug fix
|
38
|
+
* was crashing when an attribute with name like `author__id` was attempted to be read on a nil association
|
39
|
+
* boolean search from the search panel works now
|
40
|
+
|
41
|
+
# 0.8.2 - 2013-03-16
|
42
|
+
* improvements
|
43
|
+
* Add grid column config option `filter_with` (by firemind)
|
44
|
+
* Add ActionColumn (move over from Communitypack)
|
45
|
+
* `Grid.column` DSL method now appends the declared column to the list of default columns
|
46
|
+
* Add support for autoSync store option (by scho)
|
47
|
+
* Fix a glitch with Grid context menu
|
48
|
+
* Add `enable_edit_inline` option for Grid; when set to false, all editing is done via forms
|
49
|
+
* Make checkcolumn respect the `read_only` option
|
50
|
+
* Column config option `editable` has been removed, use `read_only` instead
|
51
|
+
|
52
|
+
* bug fix
|
53
|
+
* Fix one-to-many association method falling back to 'id'
|
54
|
+
* Attributes in QueryBuilder displayed as 'null'
|
55
|
+
* Various fixes for virtual attributes (by Paul Donohue)
|
56
|
+
|
57
|
+
# 0.8.1 - 2012-12-15
|
58
|
+
* bug fix
|
59
|
+
* TabPanel now shows the active tab's nested component upon loading
|
60
|
+
* Accordion now shows the active pane's nested component upon loading
|
61
|
+
|
62
|
+
* improvements
|
63
|
+
* Add support for validation errors on `before_destroy` (by firemind)
|
64
|
+
|
65
|
+
# 0.8.0 - 2012-12-09
|
66
|
+
* Basepack component renaming:
|
67
|
+
* GridPanel -> Grid
|
68
|
+
* FormPanel -> Form
|
69
|
+
* AccordionPanel -> Accordion
|
70
|
+
|
71
|
+
* improvements
|
72
|
+
* Grid/Form respect `attr_accessible` and `attr_protected` on the model; set the `role` config option on them to tune mass-assignment security
|
73
|
+
* New `data_store` config option in Grid
|
74
|
+
* Major internal refactorings
|
75
|
+
* Window now also stores its 'maximized' state
|
76
|
+
|
77
|
+
* changes
|
78
|
+
* BorderLayoutPanel is removed. Any component can now enable its items persistence by including `Netzke::Basepack::ItemPersistence` module
|
79
|
+
* Methods like `netzke_attribute`, `netzke_expose_attributes` etc are gone. Define your columns/fields directly in your grids/forms.
|
80
|
+
* Accordion and TabPanel now lazily load the Netzke components by default; set `eager_loading` to true for the components that should be loaded eagerly.
|
81
|
+
|
82
|
+
## Grid
|
83
|
+
|
84
|
+
### Customizing grid's forms
|
85
|
+
|
86
|
+
The windows with a form inside, which is used for adding/(multi-)editing of records, are now referred as: `add_window`, `edit_window` (instead of `add_form` and `edit_form`). Both accept a config param `form_config`, which can be used to configure the contained Form - e.g., to change its layout or even class. For example, to change the layout of a form that is found in the edit window, do the following in your grid class:
|
87
|
+
|
88
|
+
component :edit_window do |c|
|
89
|
+
super(c)
|
90
|
+
c.form_config.items = [:name, :author__name]
|
91
|
+
end
|
92
|
+
|
93
|
+
DSL methods `add_form_config`, `edit_form_config`, `multi_edit_form_config`, `add_form_window_config`, `edit_form_window_config`, `multi_edit_form_window_config` are gone.
|
94
|
+
|
95
|
+
### Customizing columns
|
96
|
+
|
97
|
+
Use the new `column` DSL method that accepts a block:
|
98
|
+
|
99
|
+
column :extra_column do |c|
|
100
|
+
c.text = "Extra"
|
101
|
+
end
|
102
|
+
|
103
|
+
If needed, this can be overridden in the subclass the same way as components and actions can be.
|
104
|
+
|
105
|
+
DSL method `override_column` is gone.
|
106
|
+
|
107
|
+
### Misc
|
108
|
+
|
109
|
+
`Grid.extended_search_available` -> `Grid.advanced_search_available`
|
110
|
+
|
111
|
+
# 0.7.6 - 2012-07-27
|
112
|
+
* Fix netzke-core version dependency in gemspec
|
113
|
+
|
114
|
+
# 0.7.5 - 2012-07-27
|
115
|
+
* Rails 3.2
|
116
|
+
|
117
|
+
* improvements
|
118
|
+
* data-related operations in grids and forms are moved to data adapters; implemented (partial) support for DataMapper and Sequel (see updated README)
|
119
|
+
* afterApply event in forms and grids (pschyska)
|
120
|
+
* apply event fired before apply button is processed in Form (pschyska)
|
121
|
+
|
122
|
+
* bug fix
|
123
|
+
* advanced search panel works again (pididi)
|
124
|
+
* fixed a problem with session and GridPanel
|
125
|
+
|
126
|
+
# 0.7.4 - 2012-03-05
|
127
|
+
* bug fix
|
128
|
+
* :enable_pagination is now respected in GridPanel
|
129
|
+
* Virtual columns are not sortable by default now
|
130
|
+
* Datetime column now works
|
131
|
+
* Make Window respect persistence: false
|
132
|
+
* Disable persistence for search window in GridPanel
|
133
|
+
|
134
|
+
# 0.7.3 - 2011-10-23
|
135
|
+
* bug fix
|
136
|
+
* :sorting_scope is now respected in GridPanel
|
137
|
+
* regression: filtering on association column is fix (covered with tests)
|
138
|
+
|
139
|
+
# 0.7.2 - 2011-10-20
|
140
|
+
* bug fix
|
141
|
+
* Filter on a date column
|
142
|
+
* Using date column caused Form to crash
|
143
|
+
* Virtual columns are no longer editable by default
|
144
|
+
|
145
|
+
* improvements
|
146
|
+
* New DSL method (model) for declaring a model for grids
|
147
|
+
* New DSL method (column) for declaring columns for grids
|
148
|
+
* New :override_columns config option for grid allows overriding specified column config without influencing other columns' order/presence
|
149
|
+
* New DSL method (override_column) to override a specific column config without influencing other columns' order/presence.
|
150
|
+
* Grid's title is set to model's pluralized name by default.
|
151
|
+
* New :read_only option for Form - makes all fields read-only and removes the "Apply" button.
|
152
|
+
* Form implements DSL shortcuts for the following options in default config: :model, :items, :record_id.
|
153
|
+
* GridPanel implements DSL shortcuts for the following options in default config: :model, :add_form_config, :edit_form_config, :multi_edit_form_config.
|
154
|
+
* New Form option :multi_edit - set when the form is used for editing multiple records at a time
|
155
|
+
* Introduce action columns (see BookGridWithColumnActions)
|
156
|
+
|
157
|
+
* API changes
|
158
|
+
* Skip supporting ModelExtensions. The preferred way is using setters and getters on columns/fields.
|
159
|
+
|
160
|
+
# 0.7.1 - 2011-09-04
|
161
|
+
* bug fix
|
162
|
+
* Form: fix the netzke_load endpoint when association fields are present
|
163
|
+
* dates were not displayed in date fields, and submitting a form with date fields might result in erasing those fields
|
164
|
+
|
165
|
+
* Rails 3.1 compatibility
|
166
|
+
* no meta_where dependencies (searching and filtering done with Arel)
|
167
|
+
|
168
|
+
# 0.7.0 - 2011-08-09
|
169
|
+
* Core 0.7.0 and Ext 4 compatibility
|
170
|
+
* API changes
|
171
|
+
* [JS] Removed the helper BorderLayoutPanel#get<Region>Component method altogether. Use Ext 4 Container#child instead
|
172
|
+
|
173
|
+
# v0.6.5 - to be released
|
174
|
+
* enhancements
|
175
|
+
* When columns states are saved in the persistent storage, adding/removing columns (e.g. in the code) will reset the saved states
|
176
|
+
* Moved features and specs to test/basepack_test_app
|
177
|
+
* bug fix
|
178
|
+
* Form with multiple association fields wouldn't submit data correctly
|
179
|
+
* GridPanel's forms take over the `text` configuration option for columns as `fieldLabel` for default fields
|
180
|
+
|
181
|
+
# v0.6.4 - 2011-02-26
|
182
|
+
* API changes
|
183
|
+
* The combo field able to talk to the server has changed its xtype from combobox to netzkeremotecombo. When getting values from the server via AJAX, it expects a 2-dimensional array now, where the first value is the real value (which gets submitted), and the second value is the display value.
|
184
|
+
* xdatetime is no more. datetimefield is used instead.
|
185
|
+
|
186
|
+
* enhancements
|
187
|
+
* Components updated to use Ext.Direct (by @pschyska)
|
188
|
+
* New, improved advanced search for GridPanel and PagingForm.
|
189
|
+
* One-to-many association support in Form/GridPanel reworked to use the foreign id instead of a string. This gives us more flexibility about what to display in the association column/field, and also provides for performance improvements (no more need to search for the associated record based on the value provided from the column/field).
|
190
|
+
* GridPanel now memorizes its columns visibility, position and size (when :persistence is set to true)
|
191
|
+
* I18n for GridPanel
|
192
|
+
* A default value can now also be assigned to association column/field (the value must be the associated record's ID)
|
193
|
+
* Slightly optimized selenium tests (no artificial sleeping whenever possible)
|
194
|
+
|
195
|
+
* bug fix
|
196
|
+
* Long-standing visual issues with datetime columns in grid panel are solved.
|
197
|
+
|
198
|
+
# v0.6.3 - 2011-01-14
|
199
|
+
* compatibility with netzke-core 0.6.5
|
200
|
+
|
201
|
+
* refactoring
|
202
|
+
* GridPanel code restructured, using the new `js_mixin` method
|
203
|
+
|
204
|
+
* bug fix
|
205
|
+
* GridPanel respects strong_default_attrs
|
206
|
+
* TabPanel doesn't fire multiple load requests per tab in case of lazy-loaded tabs and fast clicking
|
207
|
+
* Filtering/sorting on virtual columns is now disabled by default
|
208
|
+
* Filtering on date columns
|
209
|
+
|
210
|
+
* enhancements
|
211
|
+
* I18n for Grid/Form
|
212
|
+
* new `getter` config option for columns/fields, a lambda receiving the record as parameter
|
213
|
+
* new `setter` config option for columns/fields, a lambda receiving the record as first parameter, new value as the second
|
214
|
+
* GridPanel passes columns' default values to the "Add in form" form
|
215
|
+
* Form can now be used without specifying a model
|
216
|
+
* New `commalistcbg` form field for checkboxes, where boxLabels of selected checkboxes are serialized into comma-separated string (the separator is configurable)
|
217
|
+
* New `nradiogroup` form field for radio buttons, where the value is defined by the boxLabel of the selected radio button
|
218
|
+
* New `no_binding` option for configuring a form field. Set it to "true" when you don't want Netzke to expand the field configuration based on the `name` property. May be needed in some cases, e.g. when using checkboxes/radio buttons in the form.
|
219
|
+
* New `nested_attribute` option for configuring data attributes (thus applicable for a column, a field, or a `netzke_attribute` in the model). When set to true for an association attribute (e.g. author__name), assigning a value to it will change the association's attribute, *not* trying to find an association by name and reassign it if found (default behavior).
|
220
|
+
* Form shows the "Updating..." mask while sending values to the server (configurable with updateMask option/property)
|
221
|
+
* Form now can be used in the "lockable" mode (:config => :lockable), which makes it load initially in "display mode", then "unlock" it, change the values, and "lock" it again (updating the values on the server)
|
222
|
+
|
223
|
+
# v0.6.2 - 2010-11-05
|
224
|
+
* compatibility with netzke-core 0.6.4
|
225
|
+
* bug fix
|
226
|
+
* BorderLayoutPanel persistence fix
|
227
|
+
|
228
|
+
# v0.6.1 - 2010-11-04
|
229
|
+
* enhancements
|
230
|
+
* BorderLayoutPanel persistence: remembers region sizes and collapsed/expanded states
|
231
|
+
* tooltips for grid buttons
|
232
|
+
|
233
|
+
* bug fix
|
234
|
+
* auto-detection of association's method when the latter is virtual was broken in 1.9.2
|
235
|
+
|
236
|
+
# v0.6.0 - 2010-10-24
|
237
|
+
* netzke-core 0.6.0 compatibility, thorough refactoring
|
238
|
+
* Much more thorough testing (cucumber and rspec)
|
239
|
+
* Form/GridPanel dynamic column/field configuration has been left out (planned for a separate gem)
|
240
|
+
* different bug fixes
|
241
|
+
|
242
|
+
* enhancements
|
243
|
+
* if omitted in config, a column for the primary key is automatically added to Grid/Form
|
244
|
+
|
245
|
+
* API incompatibilities
|
246
|
+
* in Form, define the fields layout directly in :items, not in :fields or :columns
|
247
|
+
|
248
|
+
* new
|
249
|
+
* Form allows for arbitrary layout of fields
|
250
|
+
|
251
|
+
# v0.5.14 - 2010-09-08
|
252
|
+
* bug fix
|
253
|
+
* fields configurator wouldn't open in some cases
|
254
|
+
* icons location was hardcoded in search panel (credits to @pschyska)
|
255
|
+
* quick fix for datetimes not being displayed in the preferred timezone
|
256
|
+
* ext_config options :enable_edit_in_form and :enable_advanced_search now do have effect
|
257
|
+
* PropertyEditor fixed for Grid/Form
|
258
|
+
* Grid/Form again obeys persistent_config option when loading columns/fields
|
259
|
+
|
260
|
+
* enhancements
|
261
|
+
* numberfield is default in grids also for columns of type float
|
262
|
+
* more narrow exception rescuing in GridPanel code
|
263
|
+
* combobox options can now be searched ("type ahead") also in virtual columns (not efficient though, use at own risk!)
|
264
|
+
* overriding an already existing attribute with `netzke_attribute` now also has effect on association attributes, such as boss__name
|
265
|
+
|
266
|
+
# v0.5.13 - 2010-08-11
|
267
|
+
* regression
|
268
|
+
* combobox options configuration again has effect
|
269
|
+
|
270
|
+
* bug fix
|
271
|
+
* when a TabPanel was used as a standalone widget, the first tab was rendered empty
|
272
|
+
* Grid/Form: dynamically changing of columns doesn't erase those column settings that are not configurable via GUI, but which were specified in the code
|
273
|
+
|
274
|
+
* enhancements
|
275
|
+
* scopes can now be specified for an association combobox in Grid/Forms
|
276
|
+
* GridPanel: you can now configure add/edit/multi_edit/search panels (e.g. to override the fields) and corresponding windows (e.g. to override the title)
|
277
|
+
* minor refactoring GridPanel: moved static js out of grid_panel_js.rb
|
278
|
+
|
279
|
+
# v0.5.12 - 2010-06-21
|
280
|
+
* Fix: when used with Bundler, was crashing with the "uninitialized constant" exception
|
281
|
+
|
282
|
+
# v0.5.11 - 2010-06-20
|
283
|
+
* Fix: Partial fix for IE's (the rest to be fixed in Ext).
|
284
|
+
* Fix: In some circumstances Netzke::ActiveRecord modules were not loading.
|
285
|
+
|
286
|
+
# v0.5.10 - 2010-06-14
|
287
|
+
* Impr: Checkbox replaced with tri-state checkbox in multi-edit form in GridPanel.
|
288
|
+
* Impr: Column renderers reworked, allowing for more flexibility and cleanness.
|
289
|
+
* Fix: After applying changes to a grid disable "Edit in form" action.
|
290
|
+
* Impr: A grid's forms are now getting the same fields as specified for the grid.
|
291
|
+
|
292
|
+
# v0.5.9 - 2010-06-11
|
293
|
+
* !!!: after updating to this version, run script/generate netzke_basepack
|
294
|
+
* New: tri-state checkbox introduced into the search form
|
295
|
+
* Impr: better defaults for the search form
|
296
|
+
* Impr: GridPanel now displays the total amount of records
|
297
|
+
* Fix: GridPanel's "local filters" are back (they were out since the release of Ext 3.0)
|
298
|
+
* Impr: obey "preloaded" option for tabs better: really add the widgets into their respective tabs from the start
|
299
|
+
* Fix: datetime filters now also are take into account when searching in GridPanel is performed
|
300
|
+
* Fix: FieldsConfigurator should now work on Heroku
|
301
|
+
* Fix: GridPanel date filter now should work
|
302
|
+
* New: GridPanel now has a method on_data_changed that can be overridden by children to detect actions that modify data
|
303
|
+
* New: New way of configuring Netzke (virtual) attributes for AR models.
|
304
|
+
* Impr: Grid/Form refactoring.
|
305
|
+
* Impr: Multi-level column/fields configuration reworked and made more consistent.
|
306
|
+
* New: New configuration layer introduced between the AR models and the rest of Netzke widgets. Use AttributesConfigurator to access it.
|
307
|
+
* New: FamFamFam Silk icons support.
|
308
|
+
* Impr: Reworked defining Netzke (virtual) attributes for Grid/Form.
|
309
|
+
|
310
|
+
# v0.5.8 - 2010-03-12
|
311
|
+
* Fix: GertThiel's method_missing-related fix enabling better compatibility with other Ruby libs
|
312
|
+
* Fix: acts_as_list runtime dependency
|
313
|
+
|
314
|
+
# v0.5.7 - 2010-02-26
|
315
|
+
* Regression: column config for GridPanel again accepts a renderer along with its parameters (as array, where the first element is the renderers name, the second - the parameters passed to the renderer, e.g.: :renderer => ["date", "y-m-d"])
|
316
|
+
* Fix: Window resize/move now works correctly
|
317
|
+
* Code: taking care of deprecated methods
|
318
|
+
|
319
|
+
# v0.5.6 - 2010-01-10
|
320
|
+
* Compatibility with latest netzke-core
|
321
|
+
* Compatibility with Ext JS v3.1
|
322
|
+
* Impr: Code reorganization
|
323
|
+
* Impr: Non-standard primary key support in GridPanel and Form
|
324
|
+
* Impr: Search button in GridPanel indicates that records filtering is active
|
325
|
+
* Fix: by default, SearchPanel excludes boolean fields for now (until a 3-state checkbox is introduced)
|
326
|
+
* Impr: made it possible to create new AR records with assigned associations using double-underscore notation, e.g.: Clerk.new(:boss__last_name => "Aguraijuja ")
|
327
|
+
* Impr: specifying an item for Netzke::Window is now optional
|
328
|
+
* Fix: xtype field in FieldsConfigurator is now a combobox
|
329
|
+
* Fix: FieldsConfigurator was crashing when fired consequently for grid and form
|
330
|
+
* Depr: :data_class_name option is deprecated, use :model
|
331
|
+
* Impr: "gear" tool is now hidden on FieldsConfigurator
|
332
|
+
* Impr: Grid/Form layouts are now not stored into the netzke_preferences table unless the defaults are modified (cleaner table)
|
333
|
+
|
334
|
+
# v0.5.5.1 - 2009-11-09
|
335
|
+
* Compatibility with latest netzke-core
|
336
|
+
|
337
|
+
# v0.5.5 - 2009-11-09
|
338
|
+
* Compatibility with latest netzke-core
|
339
|
+
* Regression: pressing "enter" was not submitting the form (Form)
|
340
|
+
* Regression: "Restore defaults" button was not working in FieldsConfigurator and PropertyEditor
|
341
|
+
* Fix: excluding columns in FieldsConfigurator was causing inconsistent column behavior (move/hide/resize)
|
342
|
+
* Fix: resolving conflicts with Ext.form.Form's <tt>submit</tt> and <tt>load</tt> methods
|
343
|
+
* New: rudimentary FileUploadField support in Form (it will do a normal, non-AJAX, form submit)
|
344
|
+
* New: Netzke::Window widget, supports persistent moving/resizing.
|
345
|
+
* New: (experimental) GridPanel's "Add in form" button now opens the new Window widget. Later all other windows will be slowly rewritten to do the same.
|
346
|
+
|
347
|
+
# v0.5.4 - 2009-10-12
|
348
|
+
* Dependencies updated
|
349
|
+
|
350
|
+
# v0.5.3 - 2009-10-12
|
351
|
+
* Compatibility with Ext 3.0 (and dropping compatibility with 2.x).
|
352
|
+
* Compatibility with netzke-core v0.4.4.
|
353
|
+
* Impr: Form/GridPanel-based widgets: more consistent Ext.Action-related functionality and code, like (context) menu, bbar, etc.
|
354
|
+
* Impr: GridPanel: <tt>rows_reordering_available</tt> is now true by default.
|
355
|
+
* Impr: TreePanel now sets "leaf" attribute to true if the node has no children.
|
356
|
+
* Impr: Grid/TreePanel now have persistent config enabled by default.
|
357
|
+
* Impr: if persistent_config is disabled, a widget won't be talking to the server in vain any more.
|
358
|
+
* Fix: GridPanel didn't fire row editing when the first column was a "checkbox" column.
|
359
|
+
* Fix: the GridPanel's <tt>:scopes</tt> parameter now correctly processes named scopes as strings inside the array, e.g.
|
360
|
+
:scopes => ["current", [:id_gt, 100]]
|
361
|
+
* Fix: on deleting records from GridPanel, <tt>destroy</tt> method is being called instead of <tt>delete</tt>.
|
362
|
+
* Fix: FieldsConfigurator made a little bit more stable.
|
363
|
+
* Fix: patching Ext's bug that caused double firing of "columnmove" in GridPanel.
|
364
|
+
* Fix: moving columns around in GridPanel was causing erroneous mapping of data to columns after data reload.
|
365
|
+
|
366
|
+
# v0.5.2 - 2009-09-24
|
367
|
+
* Fix: combobox options for association columns didn't work properly.
|
368
|
+
* Fix: GridPanel's multi-edit functionality didn't work.
|
369
|
+
* Fix: gem dependencies are now correct.
|
370
|
+
|
371
|
+
# v0.5.1 - 2009-09-11
|
372
|
+
* Fix: crash when Form has no data_class_name specified.
|
373
|
+
* 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.
|
374
|
+
* Fix: DataAccessor widgets (Form/GridPanel) now don't crash when calculating default columns/fields for the underlying model that has polymorphic columns.
|
375
|
+
* Fix: TabPanel was sending redundant "tabchange" event to server when initially instantiated.
|
376
|
+
* Fix: column filters were making GridPanel crash when the column editor was set to "textarea".
|
377
|
+
* Fix: dongling comma and "delete" object properties caused problems in IE and Safari.
|
378
|
+
* Fix: a stand-alone TabPanel would not render the active item.
|
379
|
+
* New: BasicApp: masquerading as "World". In this mode all the "touched" persistent preferences will be overwritten for all roles and users.
|
380
|
+
* Impr: configuration panel's header now shows the underlying model's name for convenience.
|
381
|
+
* Fix: MasqueradeSelector widget added.
|
382
|
+
|
383
|
+
# v0.5.0 - 2009-09-06
|
384
|
+
* Major refactoring and code reorganization.
|
385
|
+
* Compatibility with netzke-core v0.4.0.
|
386
|
+
* New: GridPanel now supports adding/editing records in a form and extended configurable search.
|
387
|
+
* New: GridPanel now can be loaded along with initial data (saves a request to the server).
|
388
|
+
* New: context menu in GridPanel
|
389
|
+
* New: "scopes" configuration option added to GridPanel to specify the searchlogic-compatible scope for the data.
|
390
|
+
* 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.
|
391
|
+
* Usability: GridPanel's actions now get enabled/disabled according to the current selection.
|
392
|
+
* Configuration panel for grids and forms now works more consistently.
|
393
|
+
* New: some smart defaults for column/fields in Grid/Form.
|
394
|
+
* New: BasicApp supports masquerading and application-wide AJAX activity indicator.
|
395
|
+
|
396
|
+
# v0.4.2 - 2009-05-07
|
397
|
+
* Fix: afterlayout event bind removed completely because of some tricky inconsistent behavior of Ext. BasicApp initializing code put directly into js_after_constructor.
|
398
|
+
|
399
|
+
# v0.4.1 - 2009-05-07
|
400
|
+
* Fix: afterlayout call moved to js_after_constructor in BasicApp
|
401
|
+
* Fix: cleaner persistent_config handling
|
402
|
+
* New: default's configuration enabled for Form on class-level
|
403
|
+
* Fix: differently configured forms on the same page were showing the same columns
|
404
|
+
* Fix: TableEditor was showing config-tool by default (must be hidden)
|
405
|
+
|
406
|
+
# v0.4.0 - 2009-05-07
|
407
|
+
* Refactor: got rid of NetzkeFormField and NetzkeGridPanelColumn classes along with their tables. The layout is now stored in netzke_preferences.
|
408
|
+
* New: dynamic hiding of columns from column menu in GridPanel.
|
409
|
+
* New: Form now supports combo boxes.
|
410
|
+
* Fix: config[:bbar] set to 'false' now works in grids with pagination
|
411
|
+
* New: you can specify :preloaded => true in a tab config in TabPanel to preload the widget in that tab along with the TabPanel itself
|
412
|
+
* New: hideBusy added to Ext.StatusBar
|
413
|
+
* Fix: assigning association (a Boss to a Clerk) by virtual column (like boss__name) works now
|
414
|
+
* Fix: an old bug that made GridPanel misbehave after reordering the columns
|
415
|
+
|
416
|
+
# v0.3.10
|
417
|
+
* BasicApp-based widgets can now introduce arbitrary layout, following the convention of defining "main-panel" and "main-toolbar" panels with layout 'fit'.
|
418
|
+
|
419
|
+
# v0.3.9.1
|
420
|
+
* Bug fix: (regression) appLoaded() in BasicApp gets executed again
|
421
|
+
|
422
|
+
# v0.3.9
|
423
|
+
* AccordionPanel tests added
|
424
|
+
* TabPanel works now
|
425
|
+
* AccordionPanel replaced with more intuitive TabPanel in the configuration window
|
426
|
+
* Code clean-up by using "single" option to call appLoaded() on "afterlayout"
|
427
|
+
* Table editor bug fix
|
428
|
+
|
429
|
+
# v0.3.8
|
430
|
+
* Fixing Ext's EditableItem render problem.
|
431
|
+
* Filters by default enabled again in GridPanel.
|
432
|
+
* GridPanel enhancement: base_params get sent along with post_data.
|
433
|
+
|
434
|
+
# v0.3.7
|
435
|
+
* Netzke-core version sync.
|
436
|
+
* Rails 2.3.2 compatibility.
|
437
|
+
|
438
|
+
# v0.3.6
|
439
|
+
* Netzke-core v0.2.9 compatibility.
|
440
|
+
* Cleaner handling of custom renderers in GridPanel.
|
441
|
+
* New Form-based PropertyEditor replaces PropertyGrid.
|
442
|
+
* Xcheckbox and check-column introduced.
|
443
|
+
* TODO file added.
|
444
|
+
* Bug fix: in TableEditor, the grid now responses on events also after being reconfigured.
|
445
|
+
* Bug fix: a couple of IE-related bugs.
|
446
|
+
* Significant code clean-up.
|
447
|
+
|
448
|
+
# v0.3.5
|
449
|
+
* Netzke-core v0.2.8 compatibility.
|
450
|
+
|
451
|
+
# v0.3.4
|
452
|
+
* Quick tips added to the "tools".
|
453
|
+
* Regression: the "General" configuration panel for GridPanel works again.
|
454
|
+
* GridPanel: rows_per_page configuration is now read from General config panel.
|
455
|
+
|
456
|
+
# v0.3.3.1
|
457
|
+
* Obviously using "new" as a property name in JavaScript isn't liked by Safari. Fixed.
|
458
|
+
|
459
|
+
# v0.3.3
|
460
|
+
* Bug fix: application not loading the widget specified in the URL (Ext.History-related).
|
461
|
+
* Some code refactoring and readability improvements.
|
462
|
+
* Ext.componentCache renamed into Ext.netzke.cache.
|
463
|
+
* New widget: TableEditor (a compound widget containing a grid and a form for editing table data).
|
464
|
+
* BorderLayoutPanel: a function getRegionWidget(region) added to access a widget in the specified region.
|
465
|
+
* Bug fix: BasicApp: FeedbackGhost now gets instantiated before BasicApp.
|
466
|
+
* Clearer handling of requests to non-existing aggregatees.
|
467
|
+
* Bug fix: now Ext 2.2.1 compatible.
|
468
|
+
* Column operations are now handled properly when :persistent_layout is set to false.
|
469
|
+
* 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.
|
470
|
+
* :persistent_layout set to false now makes a widget ignore what's in the DB.
|
471
|
+
* Bug fix: AccordionPanel doesn't crash when no active item is specified.
|
472
|
+
* Bug fix: redundant flash messages for GridPanel.
|
473
|
+
* FeedbackGhost won't be showing anything if given an empty array.
|
474
|
+
* Cleaner handling of validations in GridPanel.
|
475
|
+
* Form ready for the demo.
|
476
|
+
|
477
|
+
# v0.3.2
|
478
|
+
* Minor code restructuring.
|
479
|
+
* Working on Form cont'd.
|
480
|
+
|
481
|
+
# v0.3.1
|
482
|
+
* Added the "conditions" configuration option to GridPanel to limit the search
|
483
|
+
* Basic column editor for grids has been replaced with FieldsConfigurator, which can do a bit more
|
484
|
+
* Added Checkbox column/form-field type for boolean fields
|
485
|
+
* "renderer" configuration option added for grid columns - any Ext.util.Format renderer can be specified there (thanks to Josh Holt for the initial idea)
|
486
|
+
|
487
|
+
# v0.3.0
|
488
|
+
* 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
|
489
|
+
|
490
|
+
# v0.2.2
|
491
|
+
* Meta: updated netzke-core version (dependency)
|
492
|
+
|
493
|
+
# v0.2.1
|
494
|
+
* Regression: BorderLayoutPanel now restores the region sizes from the database
|
495
|
+
|
496
|
+
# v0.2.0.1
|
497
|
+
* Meta: updated netzke-core version (dependency)
|
498
|
+
|
499
|
+
# v0.2.0
|
500
|
+
* Some re-factoring and redesign along with netzke-core
|
501
|
+
* Panel widget added
|
502
|
+
* BorderLayoutPanel added
|
503
|
+
* AccordionPanel added
|
504
|
+
* Bug fix: column operations configuration misbehaving
|
505
|
+
* Renamed Grid into GridPanel
|
506
|
+
* Bug fix: exception was thrown at a column operation when no layout_manager was present
|
507
|
+
* Reworked permission handling in GridPanel.
|
508
|
+
|
509
|
+
# v0.1.4.1
|
510
|
+
* Meta: updated netzke-core version (dependency)
|
511
|
+
|
512
|
+
# v0.1.4
|
513
|
+
* Grid#get_columns provides default columns even if none of layout_manager_class & column_manager_class are available
|
514
|
+
|
515
|
+
# v0.1.3.1
|
516
|
+
* Meta: updated netzke-core version (dependency)
|
517
|
+
|
518
|
+
# v0.1.3
|
519
|
+
* Path to javascript for grid filters corrected
|
520
|
+
* Bug with creating new records in the grid fixed
|
521
|
+
* Optimized away redundant sql queries when calling Grid#get_columns (sort of memoization)
|
522
|
+
* README updated
|
523
|
+
|
524
|
+
# v0.1.2.1
|
525
|
+
* Meta: trying to succeed publishing on RubyForge
|
526
|
+
|
527
|
+
# v0.1.2
|
528
|
+
* Updated README with an example of stand-alone widget usage
|
529
|
+
* Meta: updated netzke-core version (dependency)
|
530
|
+
|
531
|
+
# v0.1.1.2
|
532
|
+
* Meta: updated netzke-core version (dependency)
|
533
|
+
|
534
|
+
# v0.1.1.1
|
535
|
+
* Meta: github gem naming convention
|
536
|
+
|
537
|
+
# v0.1.1
|
538
|
+
* Cleaner exception handling while loading data to grid
|
539
|
+
* Column resize & move functionality enabled by default
|
540
|
+
* Column filters added
|
541
|
+
|
542
|
+
# v0.1.0.1
|
543
|
+
* Meta work: replacing underscore with dash in the name
|
544
|
+
|
545
|
+
# v0.1.0 - 2008-12-20
|
546
|
+
* Initial release
|
data/javascripts/basepack.js
CHANGED
@@ -12,3 +12,17 @@ Ext.define('Ext.ux.form.TriCheckbox', {
|
|
12
12
|
store: [[true, "Yes"], [false, "No"]],
|
13
13
|
forceSelection: true
|
14
14
|
});
|
15
|
+
|
16
|
+
// Fix race condition with Ext JS 5.1.0 (while testing)
|
17
|
+
// The error was: "Ext.EventObject is undefined"
|
18
|
+
// Looks like Ext.EventObject is a legacy artifact in Ext JS 5, as it can be found only twice in the whole code base,
|
19
|
+
// so, it probably gets removed in one of the next releases.
|
20
|
+
Ext.override(Ext.view.BoundList, {
|
21
|
+
onHide: function() {
|
22
|
+
var inputEl = this.pickerField.inputEl.dom;
|
23
|
+
if (Ext.Element.getActiveElement() !== inputEl) {
|
24
|
+
inputEl.focus();
|
25
|
+
}
|
26
|
+
this.callParent(arguments);
|
27
|
+
},
|
28
|
+
});
|
@@ -24,14 +24,14 @@ Ext.define('Ext.netzke.ComboBox', {
|
|
24
24
|
directFn: Netzke.providers[this.parentId].getComboboxOptions,
|
25
25
|
reader: {
|
26
26
|
type: 'array',
|
27
|
-
|
27
|
+
rootProperty: 'data'
|
28
28
|
}
|
29
29
|
}
|
30
30
|
});
|
31
31
|
|
32
|
-
store.on('beforeload', function(self,
|
33
|
-
|
34
|
-
},this);
|
32
|
+
store.on('beforeload', function(self, op) {
|
33
|
+
op.setParams(Ext.apply(op.getParams(), {attr: this.name}));
|
34
|
+
}, this);
|
35
35
|
|
36
36
|
// insert a selectable "blank line" which allows to remove the associated record
|
37
37
|
if (this.blankLine) {
|
data/lib/netzke-basepack.rb
CHANGED
@@ -14,12 +14,6 @@ module Netzke
|
|
14
14
|
%w[en de ru es].each do |lang|
|
15
15
|
I18n.load_path << File.dirname(__FILE__) + "/../locales/#{lang}.yml"
|
16
16
|
end
|
17
|
-
|
18
|
-
config.after_initialize do
|
19
|
-
Netzke::Core.external_ext_css << "#{Netzke::Core.ext_uri}/examples/ux/grid/css/RangeMenu"
|
20
|
-
Netzke::Core.external_ext_css << "#{Netzke::Core.ext_uri}/examples/ux/grid/css/GridFilters"
|
21
|
-
# Netzke::Core.external_ext_css << "#{Netzke::Core.ext_uri}/examples/ux/css/CheckHeader"
|
22
|
-
end
|
23
17
|
end
|
24
18
|
end
|
25
19
|
end
|
@@ -39,9 +39,7 @@ module Netzke::Basepack::DataAdapters
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def attr_type(attr_name)
|
42
|
-
|
43
|
-
klass = assoc.nil? ? @model_class : assoc.klass
|
44
|
-
klass.columns_hash[method].try(:type) || :string
|
42
|
+
association_attr?(attr_name) ? :integer : (@model_class.columns_hash[attr_name.to_s].try(:type) || :string)
|
45
43
|
end
|
46
44
|
|
47
45
|
# Implementation for {AbstractAdapter#get_records}
|
@@ -115,17 +113,17 @@ module Netzke::Basepack::DataAdapters
|
|
115
113
|
|
116
114
|
def virtual_attribute?(c)
|
117
115
|
assoc_name, asso = c[:name].split('__')
|
118
|
-
|
116
|
+
assoc, assoc_method = assoc_and_assoc_method_for_attr(c[:name])
|
119
117
|
|
120
118
|
if assoc
|
121
|
-
return !assoc.klass.column_names.include?(
|
119
|
+
return !assoc.klass.column_names.include?(assoc_method)
|
122
120
|
else
|
123
121
|
return !@model_class.column_names.include?(c[:name])
|
124
122
|
end
|
125
123
|
end
|
126
124
|
|
127
125
|
def combo_data(attr, query = "")
|
128
|
-
|
126
|
+
assoc, assoc_method = assoc_and_assoc_method_for_attr(attr[:name])
|
129
127
|
|
130
128
|
if assoc
|
131
129
|
# Options for an asssociation attribute
|
@@ -133,16 +131,16 @@ module Netzke::Basepack::DataAdapters
|
|
133
131
|
relation = assoc.klass.all
|
134
132
|
relation = relation.extend_with(attr[:scope]) if attr[:scope]
|
135
133
|
|
136
|
-
if assoc.klass.column_names.include?(
|
134
|
+
if assoc.klass.column_names.include?(assoc_method)
|
137
135
|
# apply query
|
138
136
|
assoc_arel_table = assoc.klass.arel_table
|
139
137
|
|
140
|
-
relation = relation.where(assoc_arel_table[
|
141
|
-
relation.to_a.map{ |r| [r.id, r.send(
|
138
|
+
relation = relation.where(assoc_arel_table[assoc_method].matches("%#{query}%")) if query.present?
|
139
|
+
relation.to_a.map{ |r| [r.id, r.send(assoc_method)] }
|
142
140
|
else
|
143
141
|
query.downcase!
|
144
142
|
# an expensive search!
|
145
|
-
relation.to_a.map{ |r| [r.id, r.send(
|
143
|
+
relation.to_a.map{ |r| [r.id, r.send(assoc_method)] }.select{ |id,value| value.to_s.downcase.include?(query) }
|
146
144
|
end
|
147
145
|
|
148
146
|
else
|
@@ -298,12 +296,11 @@ module Netzke::Basepack::DataAdapters
|
|
298
296
|
end
|
299
297
|
end
|
300
298
|
|
301
|
-
#
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
assoc
|
306
|
-
assoc.nil? ? [attr_name] : [method, assoc]
|
299
|
+
# Returns association and association method for a column
|
300
|
+
def assoc_and_assoc_method_for_attr(column_name)
|
301
|
+
assoc_name, assoc_method = column_name.split('__')
|
302
|
+
assoc = @model_class.reflect_on_association(assoc_name.to_sym) if assoc_method
|
303
|
+
[assoc, assoc_method]
|
307
304
|
end
|
308
305
|
|
309
306
|
# An ActiveRecord::Relation instance encapsulating all the necessary conditions.
|
@@ -356,10 +353,16 @@ module Netzke::Basepack::DataAdapters
|
|
356
353
|
predicates = conditions.map do |q|
|
357
354
|
q = HashWithIndifferentAccess.new(q)
|
358
355
|
|
359
|
-
|
360
|
-
method
|
361
|
-
|
362
|
-
|
356
|
+
assoc, method = q["attr"].split('__')
|
357
|
+
if method
|
358
|
+
assoc = @model_class.reflect_on_association(assoc.to_sym)
|
359
|
+
assoc_arel = assoc.klass.arel_table
|
360
|
+
attr = method
|
361
|
+
arel_table = Arel::Table.new(assoc.klass.table_name.to_sym)
|
362
|
+
else
|
363
|
+
attr = assoc
|
364
|
+
arel_table = @model_class.arel_table
|
365
|
+
end
|
363
366
|
|
364
367
|
value = q["value"]
|
365
368
|
op = q["operator"]
|
@@ -368,15 +371,15 @@ module Netzke::Basepack::DataAdapters
|
|
368
371
|
|
369
372
|
case attr_type
|
370
373
|
when :datetime
|
371
|
-
update_predecate_for_datetime(arel_table[
|
374
|
+
update_predecate_for_datetime(arel_table[attr], op, value.to_date)
|
372
375
|
when :string, :text
|
373
|
-
update_predecate_for_string(arel_table[
|
376
|
+
update_predecate_for_string(arel_table[attr], op, value)
|
374
377
|
when :boolean
|
375
|
-
update_predecate_for_boolean(arel_table[
|
378
|
+
update_predecate_for_boolean(arel_table[attr], op, value)
|
376
379
|
when :date
|
377
|
-
update_predecate_for_rest(arel_table[
|
380
|
+
update_predecate_for_rest(arel_table[attr], op, value.to_date)
|
378
381
|
else
|
379
|
-
update_predecate_for_rest(arel_table[
|
382
|
+
update_predecate_for_rest(arel_table[attr], op, value)
|
380
383
|
end
|
381
384
|
end
|
382
385
|
|
data/lib/netzke/basepack/form.rb
CHANGED
@@ -33,9 +33,6 @@
|
|
33
33
|
// Now let Ext.form.Form do the rest
|
34
34
|
this.callParent(arguments);
|
35
35
|
|
36
|
-
// To inform the parent about the apply event
|
37
|
-
this.addEvents('apply', 'cancel');
|
38
|
-
|
39
36
|
if (this.applyOnReturn) {
|
40
37
|
Ext.each(this.query('field'), function(field) {
|
41
38
|
field.on('specialkey', function(field, event) {
|
data/lib/netzke/basepack/grid.rb
CHANGED
@@ -378,19 +378,6 @@ module Netzke
|
|
378
378
|
# JavaScript includes
|
379
379
|
ex = Netzke::Core.ext_path.join("examples")
|
380
380
|
|
381
|
-
# Includes for column filters
|
382
|
-
if column_filters_available
|
383
|
-
[
|
384
|
-
"ux/grid/menu/ListMenu.js",
|
385
|
-
"ux/grid/menu/RangeMenu.js",
|
386
|
-
"ux/grid/FiltersFeature.js"
|
387
|
-
].each{ |path| c.require(ex.join(path)) }
|
388
|
-
|
389
|
-
%w{Boolean Date List Numeric String}.unshift("").each do |f|
|
390
|
-
c.require(ex.join"ux/grid/filter/#{f}Filter.js")
|
391
|
-
end
|
392
|
-
end
|
393
|
-
|
394
381
|
c.require :extensions
|
395
382
|
end
|
396
383
|
|
@@ -4,12 +4,10 @@
|
|
4
4
|
*/
|
5
5
|
Ext.define('Netzke.classes.Basepack.Grid.ArrayReader', {
|
6
6
|
extend: 'Ext.data.reader.Array',
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
this.callParent(arguments);
|
12
|
-
this.addEvents('endpointcommands');
|
7
|
+
config: {
|
8
|
+
rootProperty: 'data',
|
9
|
+
successProperty: 'success',
|
10
|
+
totalProperty: 'total',
|
13
11
|
},
|
14
12
|
read: function(response) {
|
15
13
|
var data = {data: response.data, total: response.total, success: response.success};
|
@@ -62,11 +60,12 @@ Ext.define('Netzke.classes.Basepack.Grid.Proxy', {
|
|
62
60
|
},
|
63
61
|
|
64
62
|
create: function(op, callback, scope) {
|
65
|
-
var
|
63
|
+
var records = op.getRecords(),
|
64
|
+
data = Ext.Array.map(records, function(r) { return Ext.apply(r.getData(), {internal_id: r.internalId}); });
|
66
65
|
|
67
66
|
this.grid.serverCreate(data, function(res) {
|
68
67
|
var errors = [];
|
69
|
-
Ext.each(
|
68
|
+
Ext.each(records, function(r) {
|
70
69
|
var rid = r.internalId,
|
71
70
|
recordData = res[rid].record,
|
72
71
|
error = res[rid].error;
|
@@ -121,9 +120,20 @@ Ext.define('Netzke.classes.Basepack.Grid.Proxy', {
|
|
121
120
|
|
122
121
|
// Build consistent request params
|
123
122
|
paramsFromOperation: function(operation) {
|
124
|
-
var params = Ext.
|
125
|
-
|
123
|
+
var params = Ext.apply({}, this.getParams(operation));
|
124
|
+
|
125
|
+
if (params.filter) {
|
126
|
+
params.filters = Ext.decode(params.filter);
|
127
|
+
delete params.filter;
|
128
|
+
}
|
129
|
+
|
130
|
+
if (params.sort) {
|
131
|
+
params.sorters = Ext.decode(params.sort);
|
132
|
+
delete params.sort;
|
133
|
+
}
|
134
|
+
|
126
135
|
Ext.apply(params, this.extraParams);
|
136
|
+
|
127
137
|
return params;
|
128
138
|
}
|
129
139
|
});
|
@@ -138,14 +148,3 @@ Ext.override(Ext.ux.CheckColumn, {
|
|
138
148
|
else return this.callOverridden(arguments);
|
139
149
|
}
|
140
150
|
});
|
141
|
-
|
142
|
-
// Fix 2-digit precision in the numeric column filter
|
143
|
-
Ext.define('Ext.ux.grid.menu.RangeMenu', {
|
144
|
-
override: 'Ext.ux.grid.menu.RangeMenu',
|
145
|
-
menuItemCfgs : {
|
146
|
-
emptyText: 'Enter Number...',
|
147
|
-
selectOnFocus: false,
|
148
|
-
width: 155,
|
149
|
-
decimalPrecision: 10
|
150
|
-
},
|
151
|
-
});
|
@@ -15,21 +15,20 @@
|
|
15
15
|
|
16
16
|
// Enable filters feature
|
17
17
|
if (this.enableColumnFilters) {
|
18
|
-
this.
|
19
|
-
encode: true,
|
20
|
-
ftype: 'filters'
|
21
|
-
});
|
18
|
+
this.plugins.push('gridfilters');
|
22
19
|
}
|
23
20
|
|
24
21
|
// Normalize columns. Extract data fields and meta column.
|
25
22
|
this.netzkeProcessColumns();
|
26
23
|
|
27
24
|
// Define the model
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
25
|
+
if (!this.netzkeIsModelDefined()) {
|
26
|
+
Ext.define(this.netzkeModelName(), {
|
27
|
+
extend: 'Ext.data.Model',
|
28
|
+
idProperty: this.pri, // Primary key
|
29
|
+
fields: this.fields
|
30
|
+
});
|
31
|
+
}
|
33
32
|
delete this.pri;
|
34
33
|
delete this.fields;
|
35
34
|
|
@@ -164,28 +163,6 @@
|
|
164
163
|
this.getStore().on('beforeload', this.netzkeRememberSelection, this);
|
165
164
|
this.getView().on('refresh', this.netzkeRestoreSelection, this);
|
166
165
|
}
|
167
|
-
|
168
|
-
// In EXT JS 4.1 the filters object isn't initialized
|
169
|
-
if (this.enableColumnFilters)
|
170
|
-
{
|
171
|
-
if (this.filters === undefined) {
|
172
|
-
view = this.getView();
|
173
|
-
if (view.initFeatures) {
|
174
|
-
view.initFeatures();
|
175
|
-
var f = false;
|
176
|
-
Ext.each(view.features, function(item, index, allItems){
|
177
|
-
if (item.ftype && item.ftype == 'filters'){
|
178
|
-
f = item;
|
179
|
-
}
|
180
|
-
});
|
181
|
-
if(f && (f.filters === undefined || f.filters.items.length == 0)){
|
182
|
-
f.createFilters();
|
183
|
-
}
|
184
|
-
}
|
185
|
-
} else {
|
186
|
-
this.filters.createFilters();
|
187
|
-
}
|
188
|
-
}
|
189
166
|
},
|
190
167
|
|
191
168
|
netzkeProcessColumns: function() {
|
@@ -246,7 +223,7 @@
|
|
246
223
|
|
247
224
|
// Setting the default filter type
|
248
225
|
if (c.filterable != false && !c.filter) {
|
249
|
-
c.filter = {type: this.netzkeFilterTypeForAttrType(c.attrType)};
|
226
|
+
c.filter = {type: c.assoc ? 'string' : this.netzkeFilterTypeForAttrType(c.attrType)};
|
250
227
|
}
|
251
228
|
|
252
229
|
// setting dataIndex
|
@@ -257,10 +234,11 @@
|
|
257
234
|
|
258
235
|
netzkeBuildStore: function() {
|
259
236
|
var store = Ext.create('Ext.data.Store', Ext.apply({
|
260
|
-
model: this.
|
237
|
+
model: this.netzkeModelName(),
|
261
238
|
proxy: this.netzkeBuildProxy(),
|
262
239
|
pruneModifiedRecords: true,
|
263
240
|
remoteSort: true,
|
241
|
+
remoteFilter: true,
|
264
242
|
pageSize: this.rowsPerPage,
|
265
243
|
autoLoad: !this.loadInlineData
|
266
244
|
}, this.dataStore));
|
@@ -287,9 +265,9 @@
|
|
287
265
|
|
288
266
|
netzkeFilterTypeForAttrType: function(attrType){
|
289
267
|
var map = {
|
290
|
-
integer : '
|
291
|
-
decimal : '
|
292
|
-
float : '
|
268
|
+
integer : 'number',
|
269
|
+
decimal : 'number',
|
270
|
+
float : 'number',
|
293
271
|
datetime : 'date',
|
294
272
|
date : 'date',
|
295
273
|
string : 'string',
|
@@ -331,6 +309,14 @@
|
|
331
309
|
return r.isNew ? "grid-dirty-record" : ""
|
332
310
|
},
|
333
311
|
|
312
|
+
netzkeModelName: function(){
|
313
|
+
return "Netzke.models." + this.id;
|
314
|
+
},
|
315
|
+
|
316
|
+
netzkeIsModelDefined: function(){
|
317
|
+
return !!(Netzke.models || {})[this.id];
|
318
|
+
},
|
319
|
+
|
334
320
|
// Normalizes the renderer for a column.
|
335
321
|
// Renderer may be:
|
336
322
|
// 1) a string that contains the name of the function to be used as renderer.
|
@@ -387,7 +373,7 @@
|
|
387
373
|
c.scope = this;
|
388
374
|
var passedRenderer = c.renderer; // renderer we got from netzkeNormalizeRenderer
|
389
375
|
c.renderer = function(value, a, r, ri, ci, store, view){
|
390
|
-
var column = view.headerCt.items.getAt(ci
|
376
|
+
var column = view.headerCt.items.getAt(ci),
|
391
377
|
editor = column.getEditor && column.getEditor(),
|
392
378
|
recordFromStore = editor && editor.isXType('combobox') && editor.getStore().findRecord('value', value),
|
393
379
|
renderedValue;
|
@@ -395,8 +381,7 @@
|
|
395
381
|
if (recordFromStore) {
|
396
382
|
renderedValue = recordFromStore.get('text');
|
397
383
|
} else if (c.assoc && r.get('meta')) {
|
398
|
-
|
399
|
-
renderedValue = (assocValue == undefined) ? c.emptyText : assocValue;
|
384
|
+
renderedValue = r.get('meta').associationValues[c.name] || c.emptyText;
|
400
385
|
} else {
|
401
386
|
renderedValue = value;
|
402
387
|
}
|
@@ -96,11 +96,10 @@ module Netzke
|
|
96
96
|
|
97
97
|
def normalize_filters(filters)
|
98
98
|
filters.map do |f|
|
99
|
-
{ attr: f["
|
99
|
+
{ attr: f["property"], value: f["value"], operator: f["operator"] }.tap do |norm|
|
100
100
|
|
101
101
|
# Ext JS filters send us date in the American format
|
102
|
-
if f["
|
103
|
-
norm[:value].match(/^(\d\d)\/(\d\d)\/(\d\d\d\d)$/)
|
102
|
+
if f["value"].is_a?(String) && f["value"].match(/^(\d\d)\/(\d\d)\/(\d\d\d\d)$/)
|
104
103
|
norm[:value] = "#{$3}-#{$1}-#{$2}"
|
105
104
|
end
|
106
105
|
|
@@ -9,24 +9,24 @@ module Netzke
|
|
9
9
|
i18n_path = "netzke.basepack.search_panel.%s"
|
10
10
|
|
11
11
|
ATTRIBUTE_OPERATORS_MAP = {
|
12
|
-
integer
|
12
|
+
:integer => [
|
13
13
|
["eq", I18n.t(i18n_path % 'equals')],
|
14
14
|
["gt", I18n.t(i18n_path % 'greater_than')],
|
15
15
|
["lt", I18n.t(i18n_path % 'less_than')]
|
16
16
|
],
|
17
|
-
text
|
17
|
+
:text => [
|
18
18
|
["contains", I18n.t(i18n_path % 'contains')] # same as matches => %string%
|
19
19
|
],
|
20
|
-
string
|
20
|
+
:string => [
|
21
21
|
["contains", I18n.t(i18n_path % 'contains')], # same as matches => %string%
|
22
22
|
["matches", I18n.t(i18n_path % 'matches')]
|
23
23
|
],
|
24
|
-
boolean
|
24
|
+
:boolean => [
|
25
25
|
["is_any", I18n.t(i18n_path % 'is_true')],
|
26
26
|
["is_true", I18n.t(i18n_path % 'is_true')],
|
27
27
|
["is_false", I18n.t(i18n_path % 'is_false')]
|
28
28
|
],
|
29
|
-
date
|
29
|
+
:date => [
|
30
30
|
["eq", I18n.t(i18n_path % 'date_equals')],
|
31
31
|
["gt", I18n.t(i18n_path % 'after')],
|
32
32
|
["lt", I18n.t(i18n_path % 'before')],
|
@@ -36,8 +36,6 @@ module Netzke
|
|
36
36
|
}
|
37
37
|
|
38
38
|
ATTRIBUTE_OPERATORS_MAP[:datetime] = ATTRIBUTE_OPERATORS_MAP[:date]
|
39
|
-
ATTRIBUTE_OPERATORS_MAP[:decimal] = ATTRIBUTE_OPERATORS_MAP[:integer]
|
40
|
-
ATTRIBUTE_OPERATORS_MAP[:float] = ATTRIBUTE_OPERATORS_MAP[:integer]
|
41
39
|
|
42
40
|
js_configure do |c|
|
43
41
|
c.extend = "Ext.form.FormPanel"
|
@@ -119,8 +119,6 @@ Ext.define('Netzke.classes.Netzke.Basepack.SearchPanel.ConditionField', {
|
|
119
119
|
this.attrCombo = this.getComponent('attrCombo');
|
120
120
|
this.operatorCombo = this.getComponent('operatorCombo');
|
121
121
|
this.valueField = this.getComponent('valueField');
|
122
|
-
|
123
|
-
this.addEvents('configured'); // user selects the attribute from the attribute combo
|
124
122
|
},
|
125
123
|
|
126
124
|
isConfigured: function() {
|
data/netzke-basepack.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.test_files = Dir["{test}/**/*"]
|
14
14
|
s.require_paths = ["lib"]
|
15
15
|
|
16
|
-
s.add_dependency 'netzke-core', '~> 0.
|
16
|
+
s.add_dependency 'netzke-core', '~> 0.12.0.beta'
|
17
17
|
|
18
18
|
s.add_development_dependency 'rails', '~> 4.2.0'
|
19
19
|
s.add_development_dependency 'sqlite3'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: netzke-basepack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Gorin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: netzke-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.12.0.beta
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.12.0.beta
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,9 +127,7 @@ files:
|
|
127
127
|
- lib/netzke/basepack/field_config.rb
|
128
128
|
- lib/netzke/basepack/fields.rb
|
129
129
|
- lib/netzke/basepack/form.rb
|
130
|
-
- lib/netzke/basepack/form/javascripts/comma_list_cbg.js
|
131
130
|
- lib/netzke/basepack/form/javascripts/form.js
|
132
|
-
- lib/netzke/basepack/form/javascripts/n_radio_group.js
|
133
131
|
- lib/netzke/basepack/form/javascripts/readonly_mode.js
|
134
132
|
- lib/netzke/basepack/form/services.rb
|
135
133
|
- lib/netzke/basepack/form/stylesheets/readonly_mode.css
|
@@ -1,50 +0,0 @@
|
|
1
|
-
Ext.ns("Ext.netzke.form");
|
2
|
-
|
3
|
-
/*
|
4
|
-
A very simple CheckboxGroup extension, which serializes its checkboxes' "boxLabel" attributes into a string.
|
5
|
-
Config options:
|
6
|
-
* separator - separator of values in the string (defaults to ",")
|
7
|
-
* options - all checkboxes, by boxLabel, e.g.: ["Cool", "To read", "Important"]
|
8
|
-
*/
|
9
|
-
Ext.define('Ext.netzke.form.CommaListCbg', {
|
10
|
-
extend: 'Ext.form.CheckboxGroup',
|
11
|
-
alias: 'widget.commalistcbg',
|
12
|
-
separator: ",",
|
13
|
-
|
14
|
-
initComponent: function(){
|
15
|
-
this.items = [];
|
16
|
-
Ext.each(this.options, function(o){
|
17
|
-
this.items.push({ boxLabel: o, displayOnly:true });
|
18
|
-
}, this);
|
19
|
-
|
20
|
-
this.callParent();
|
21
|
-
},
|
22
|
-
|
23
|
-
getSubmitData: function(){
|
24
|
-
var res = [];
|
25
|
-
Ext.each(this.getChecked(), function( item ){ res.push( item.boxLabel ) });
|
26
|
-
res = res.join(this.separator);
|
27
|
-
var o = {};
|
28
|
-
o[this.name]=res;
|
29
|
-
return o;
|
30
|
-
},
|
31
|
-
|
32
|
-
setValue: function(v){
|
33
|
-
if (Ext.isString(v)) {
|
34
|
-
var passedValues = v.split(this.separator);
|
35
|
-
this.items.each(function(i){
|
36
|
-
i.setValue( passedValues.indexOf(i.boxLabel) >= 0 );
|
37
|
-
});
|
38
|
-
// we can alse set values the Ext way
|
39
|
-
} else {
|
40
|
-
this.callParent(arguments);
|
41
|
-
}
|
42
|
-
},
|
43
|
-
|
44
|
-
setReadonlyMode: function(onOff) {
|
45
|
-
this.items.each(function(i){
|
46
|
-
i.setReadonlyMode(onOff);
|
47
|
-
});
|
48
|
-
}
|
49
|
-
|
50
|
-
});
|
@@ -1,42 +0,0 @@
|
|
1
|
-
Ext.ns("Ext.netzke.form");
|
2
|
-
/*
|
3
|
-
A very simple RadioGroup extension.
|
4
|
-
Config options:
|
5
|
-
* options:
|
6
|
-
1) all radio buttons, by boxLabel, e.g.: ["Cool", "To read", "Important"]
|
7
|
-
2) array of arrays in format [value, label], e.g.: [[1, "Good"], [2, "Average"], [3, "Poor"]]
|
8
|
-
*/
|
9
|
-
Ext.define('Ext.netzke.form.NRadioGroup', {
|
10
|
-
extend: 'Ext.form.RadioGroup',
|
11
|
-
alias: 'widget.nradiogroup',
|
12
|
-
initComponent: function(){
|
13
|
-
this.callParent();
|
14
|
-
|
15
|
-
this.items = [];
|
16
|
-
|
17
|
-
Ext.each(this.options, function(o){
|
18
|
-
if (Ext.isArray(o)){
|
19
|
-
this.items.push({boxLabel: o[1], name: this.name, inputValue: o[0]});
|
20
|
-
} else {
|
21
|
-
this.items.push({boxLabel: o, name: this.name, inputValue: o});
|
22
|
-
}
|
23
|
-
}, this);
|
24
|
-
|
25
|
-
// delete this.name;
|
26
|
-
},
|
27
|
-
|
28
|
-
getValue: function() {
|
29
|
-
var value;
|
30
|
-
this.items.each(function(i) {
|
31
|
-
value = i.inputValue;
|
32
|
-
return !i.getValue();
|
33
|
-
});
|
34
|
-
return value;
|
35
|
-
},
|
36
|
-
|
37
|
-
setReadonlyMode: function(onOff) {
|
38
|
-
this.items.each(function(i){
|
39
|
-
i.setReadonlyMode(onOff);
|
40
|
-
});
|
41
|
-
}
|
42
|
-
});
|