php - Google Material design: data table action -


so, testing out google material design. in table component, can select multiple rows.

i have following function deletes individual row (or data contains)

 <a onclick="return confirm('are sure?');" href="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'my-delete-product', 'product_id' => $post->id ), my_get_navigation_url('products') ), 'my-delete-product' ); ?>"><i class="material-icons">delete</i></a> 

now, once multiple rows selected, not sure how apply delete function selected rows.

here have far in terms of design: (http://www.getmdl.io/components/index.html#tables-section)

<table class="mdl-data-table mdl-js-data-table mdl-data-table--selectable mdl-shadow--2dp">   <thead>     <tr>       <th class="mdl-data-table__cell--non-numeric">material</th>       <th>quantity</th>       <th>unit price</th>     </tr>   </thead>   <tbody>     <tr>       <td class="mdl-data-table__cell--non-numeric">acrylic (transparent)</td>       <td>25</td>       <td>$2.90</td>      </tr>     <tr>       <td class="mdl-data-table__cell--non-numeric">plywood (birch)</td>       <td>50</td>       <td>$1.25</td>     </tr>     <tr>       <td class="mdl-data-table__cell--non-numeric">laminate (gold on blue)</td>       <td>10</td>       <td>$2.35</td>     </tr>   </tbody> </table> 

i can have button outside of table. not sure how "link" selected rows "delete" function itself. guessing need use jquery or something.

anyway, suggestions appreciated.

thanks!

no dont. need keep track selected rows , action when clicki g on delete. there easier way, use componenf has support need: https://github.com/iamisti/mddatatable


Comments