Skip to content

Commit

Permalink
EZP-27572: Markdown specs for the selection buttons.
Browse files Browse the repository at this point in the history
  • Loading branch information
StephaneDiot committed Jul 11, 2017
1 parent e4602b8 commit 6af4559
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions doc/spec/selection-button.md
@@ -0,0 +1,21 @@
## Provides the suggested markup for the selection buttons


```html
<table class="ez-selection-table" data-selection-buttons=".mybutton">
<tr class="ez-selection-table-row">
<td>
<input type="checkbox" class="ez-selection-table-checkbox">
</td>
</tr>
<!-- ... -->
</table>
<button class="mybutton" data-can-multiple-selection="true" disabled="disabled">Do!</button>
```



This is a very similar markup from what we had in PlatformUI (see https://github.com/ezsystems/PlatformUIBundle/blob/master/Resources/public/js/extensions/ez-selection-table.js#L27) :

When a `ez-selection-table-checkbox` checkbox is checked, its `ez-selection-table-row` ancestor gets the `is-row-selected` class and if there's one checked checkbox, the buttons that match the selector in the `data-selection-buttons` attribute are enabled.
If others checkboxes are checked the button will still stay enabled if it has its `data-can-multiple-selection` to `true`. If it's not it will get disabled back.

0 comments on commit 6af4559

Please sign in to comment.