Skip to content

Commit

Permalink
Update migration guide
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdan committed Nov 10, 2024
1 parent ace61b3 commit 5ead012
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions version-2/Readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ and avoid collisions with other libraries:
| separator | datagrid-range-separator |
| checkboxes | datagrid-enum-checkboxes |

All classes are now explicitly assinged inside datagrid partials.
[Modify built-in partials](https://github.com/bogdan/datagrid/wiki/Frontend#modifying-built-in-partials)
if you want to change them.

Diff for [built-in partials between V1 and V2](./views.diff)
See [a new built-in CSS file](../app/assets/datagrid.css).

Expand Down Expand Up @@ -254,10 +258,11 @@ instead of classes for meta information from backend.
Therefor built-in partials now generate data attributes by default
instead of classes for column names:

Diff for [built-in partials between V1 and V2](./views.diff)

### Filters

Version 1:

``` html
<div class="datagrid-filter filter">
<label for="form_for_grid_category">Category</label>
Expand All @@ -276,6 +281,8 @@ Version 2:
</div>
```

Diff for [built-in partials between V1 and V2](./views.diff)

### Columns

Version 1:
Expand Down Expand Up @@ -318,14 +325,16 @@ If you still want to have an HTML class attached to a column use `class` column
column(:name, class: 'short-column')
```

Renders:

``` html
<th class="short-column" data-column="name">Name</th>
...
<td class="short-column" data-column="name">John</td>
```

If you want to change this behavior completely,
modify [built-in partials](https://github.com/bogdan/datagrid/wiki/Frontend#modifying-built-in-partials)
[Modify built-in partials](https://github.com/bogdan/datagrid/wiki/Frontend#modifying-built-in-partials)
if you want to change this behavior completely.

## Inherit Datagrid::Base

Expand Down

0 comments on commit 5ead012

Please # to comment.