ratiw / vue-table

data table simplify! -- vuetable is a Vue.js component that will automatically request (JSON) data from the server and display them nicely in html table with swappable/extensible pagination component.
MIT License
1.83k stars 303 forks source link

Checkbox custom template #101

Open HenoTaMyJIb opened 8 years ago

HenoTaMyJIb commented 8 years ago

Hi,

Right now I have a custom special field for a more fancier checkbox.

template: [
      '<div class="checkbox-custom checkbox-primary">
          <input type="checkbox" id="checkbox_{{rowData.id}}"
            @change="$parent.toggleCheckbox($event.target.checked, rowData, '__checkbox:id')"
            :checked="$parent.isSelectedRow(rowData, '__checkbox:id')"
          >
          <label for="checkbox_{{rowData.id}}"> </label>
        </div>'
    ].join(''),

And everything is fine, but would be nice to also have a custom checkbox to toggle all rows.

Is it possible to add a custom template for checkbox special field or a custom th html to show checkbox.

ratiw commented 8 years ago

@HenoTaMyJIb I believe anything is possible. But it would be great if you could try it, then submit the PR. Don't have time to work on vuetable right now, sorry.