mdDataTable icon indicating copy to clipboard operation
mdDataTable copied to clipboard

Sortable columns doesn't work with Ajax support

Open laurentperroteau opened this issue 9 years ago • 2 comments

Codepen fork exemple.

laurentperroteau avatar Jan 03 '17 11:01 laurentperroteau

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):

  1. Pass a third argument to mdt-row-paginator="paginatorCallback(page, pageSize, options)" (if a column is sorted, the object of the column have sort: 'asc' (or desc)
  2. Get the index of columns that have "sort" information (I use Lodash): _.findIndex(options.columnSort, 'sort')
  3. 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)

laurentperroteau avatar Jan 03 '17 16:01 laurentperroteau

Agree, I have no idea it all is working in the demo

singhay avatar Jul 19 '17 16:07 singhay