JULY 24, 2012
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_javascriptshave 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.scssto 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_attrsbecomes:html:header_tr_html_attrsbecomes:header_tr_html
- Parameter names in column definitions have been renamed:
:column_namebecomes:name:attribute_namebecomes:attribute:model_classbecomes:model:allow_orderingbecomes:ordering:td_html_attrsbecomes:html- Negation in the parameter name does not contribute to the simplicity of an API, so
:no_filterin becomes:filter. Consequently,:no_filter => truebecomes:filter => false :negation_in_filterbecomes: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: leikind/3170204
- New configuration parameter
DEFAULT_TABLE_CLASSEScontains 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 => :standardin the column definition. - The second variable injected into to
before_rowandafter_rowblock, and the first parameter injected into thelast_rowis the number of columns in the current grid. :csv_field_separatoris a new parameter forinitialize_griddefining the field separator in CSV files. The default separator is defined byCSV_FIELD_SEPARATORin the config file.- New parameter
:confirmforsaved_queries_panelwhich 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_javascriptandreset_grid_javascriptto 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-buttonorwg-external-reset-button, and attributedata-grid-namewhose value is the name of the grid:
<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 is wg-external-csv-export-button:
<button class="wg-external-csv-export-button" data-grid-name="grid">Export To CSV</button>