mdDataTable
mdDataTable copied to clipboard
Sortable columns doesn't work with Ajax support
Finally, it's was not really a bug ! If you use Ajax support, you need to order columns before return array to mdDataTable (see updated codepen fork exemple):
- Pass a third argument to
mdt-row-paginator="paginatorCallback(page, pageSize, options)"(if a column is sorted, the object of the column havesort: 'asc'(or desc) - Get the index of columns that have "sort" information (I use Lodash):
_.findIndex(options.columnSort, 'sort') - Use it to get the corresponding column name, if "asc" or "desc" and then order your array
Anyway, this feature needs more documentation (in the README and in the Codepen)
Agree, I have no idea it all is working in the demo