WiceGrid version 3.2.0.pre1
WiceGrid version 3.2.0.pre1 has been released, and the WiceGrid testbed application has been updated.
Here is the changelog:
- Support for Prototype has been dropped. No hard feelings, Prototype, no matter what others say, I liked you, and I am perhaps the last one to have dumped you :)
- All assets are in the asset pipeline. All javascript is now coffeescript. No more Rails 2 legacy in the form of obtrusive javascript in the HTML page. The styles file is copied to the application asset directory by a generate task so that is it easy to modify it to the application needs. The javascript and images are loaded from the plugin. Read the Installation section in README for details. Thanks to the asset pipeline taking care of loading assets for us, methods
include_wice_grid_assets
,names_of_wice_grid_stylesheets
, andnames_of_wice_grid_javascripts
have been removed - WiceGrid is compatible with Twitter Bootstrap out of the box.
- Paths to various images used by WiceGrid have been removed from the configuration file and are now defined only in the css file. Developers are encouraged to modify
wice_grid.css.scss
to use other images and to change the styles in general. - The markup and css classes that WiceGrid generates have changed, and CSS for older versions of WiceGrid might not work. Inspect the source code.
- Parameter names in the grid helper have been renamed:
-
:table_html_attrs
becomes:html
-
:header_tr_html_attrs
becomes:header_tr_html
-
- Parameter names in column definitions have been renamed:
-
:column_name
becomes:name
-
:attribute_name
becomes:attribute
-
:model_class
becomes:model
-
:allow_ordering
becomes:ordering
-
:td_html_attrs
becomes:html
- Negation in the parameter name does not contribute to the simplicity of an API, so
:no_filter
in becomes:filter
. Consequently,:no_filter => true
becomes:filter => false
-
:negation_in_filter
becomes:negation
-
-
ERB mode has been removed. It had never been used by anyone and is bad style anyway. In case you have no idea what it was, here’s what it was:
- New configuration parameter
DEFAULT_TABLE_CLASSES
contains CSS classes added to all WiceGrid tables by default. - In previous versions of WiceGrid in the jQuery mode DateTime filters used to automatically fall back to Rails DateTime helpers due to absence of time controls in jQuery DatePicker. In version 3.2 this behavior has been changed to always use jQuery DatePicker, even with DateTime filters. Of course it is possible to force Rails DateTime with
:helper_style => :standard
in the column definition. - The second variable injected into to
before_row
andafter_row
block, and the first parameter injected into thelast_row
is the number of columns in the current grid. -
:csv_field_separator
is a new parameter forinitialize_grid
defining the field separator in CSV files. The default separator is defined byCSV_FIELD_SEPARATOR
in the config file. - New parameter
:confirm
forsaved_queries_panel
which turns on or off the JS confirm dialogs when deleting saved queries. - Instead of the old rake task creating a table for serialized queries a generator has been added which adds a migration file to
db/migrations
. - Instead of using helpers
submit_grid_javascript
andreset_grid_javascript
to create external Submit and Reset buttons all you have to do is add a button or any other clickable HTML element with classwg-external-submit-button
orwg-external-reset-button
, and attributedata-grid-name
whose value is the name of the grid:1 2
<button class="wg-external-submit-button" data-grid-name="grid">Submit</button> <button class="wg-external-reset-button" data-grid-name="grid">Reset</button>
The same goes for the external CSV export button, only the CSS class iswg-external-csv-export-button
:1
<button class="wg-external-csv-export-button" data-grid-name="grid">Export To CSV</button>
July 24, 2012 | | Tagged rails, wicegrid