vue-materialize-datatable
vue-materialize-datatable copied to clipboard
Sortable on a th, td manually defined fields
I think I'm close but it blows up the page when I apply :sortable in the wrong place. With the below code I've been able to get the two manually defined columns to work. The problem now is getting sortable to work with my date column. I've tried adding :sortable=true, :sortable="true" to the
https://jsfiddle.net/bismarck611/tmh5k32x/
<datatable :title="titleTextCheck" :columns="tableColumns1" :rows="userSitesFilter"> <th slot="thead-tr">Updated</th> <th slot="thead-tr">Actions</th> <template slot="tbody-tr" scope="props"> <td>{{ props.row.updatedOn | formatDate }}</td> <td> <button @click="(e) => $refs.modalName.openModal(props.row, e)" class="waves-effect waves-light btn blue darken-4"> View/Edit </button> <button v-if="userProfile.role === 'blah'" @click=" (e) => $refs.statusChangeModalName.openStatusChangeModal(props.row, e)" class="waves-effect waves-light btn blue darken-4"> Status </button> </td> </template> </datatable>
A sortingFunc property in columns would be a good idea.