ratiw / vuetable-2-tutorial

MIT License
258 stars 67 forks source link

Sort not working #74

Closed nusendra closed 6 years ago

nusendra commented 6 years ago

my table can't sort. here is my code

<vuetable ref="vuetable" api-url="datatables/site" 
:fields="table.fields" 
:sort-order="table.sortOrder" 
pagination-path="" 
@vuetable:pagination-data="onPaginationData"></vuetable>

script

table: {
    sortOrder: [
      {
        field: 'nama_site',
        direction: 'desc'
      }
    ],
    fields: [
      "No",
      {
        name: "jenis_site.jenis_site",
        title: "Jenis Site",
        sortField: "jenis_site.jenis_site"
      },
      {
        name: "nama_site",
        title: "Nama Site",
        sortField: "created_at"
      },
      {
        name: "alamat",
        title: "Alamat",
        sortField: "alamat"
      },
      "Actions"
    ]
  },

The datatable works perfectly, but it cant sort. how to fix this sir @ratiw ? Thanks

nandlal-tjm commented 5 years ago

Your api must support sort