material-design-lite: Dynamic rows in selectable data table does not have checkbox [v1.0.0]
The data table creates checkboxes for each row upon initation. So if rows are added dynamically afterwards, the checkboxes are not shows.
A solution would have been to use componentHandler.upgradeElement
or componentHandler.upgradeDom
, but since the table
has already been upgraded, those two calls are simply ignored. Moreover since the data table doesn’t provide a downgrade method, there is no other way (that I know of) to add checkboxes to dynamically added rows.
An example (implemented with React) can be found here.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 17
“hack” with marionettejs: on onShow() call componentHandler.upgradeAllRegistered().
please solve this if is am issue
This is a reasonable decision, but it would be fair to at least have the official docs on tables not use
mdl-data-table--selectable
, don’t you think?We are officially deprecating the automatic checkbox generation for data tables. Please see the wiki page for instructions on how this should be replaced in your current code. The new method allows developers more control over the checkboxes in every way, as well as more intuitive removing and adding new rows.
Due to this deprecation we will not be adding this or any other new functionality for this component’s JS.
+1
Remove ‘data-upgraded’ attr from table, and upgradeDom again should did the trick.
We don’t need +1’s on anything. If you wish to get updates please use the subscribe button for the issue in the right sidebar for the issue.
+1 Man, I really need this component! I’m trying to build SPA using MDL + Marionette.