--- a/src/pyams_skin/table.py Sun Mar 11 11:23:42 2018 +0100
+++ b/src/pyams_skin/table.py Mon Mar 12 16:44:36 2018 +0100
@@ -78,6 +78,7 @@
},
'th': {
'data-ams-column-name': lambda x, col: x.__name__,
+ 'data-ams-datatable-sortable': self.get_sortable_column,
'data-ams-datatable-stype': self.get_column_type
}
}
@@ -98,6 +99,10 @@
return self.request.params.get(self.prefix + '-sortOrder', self.sortOrder)
@staticmethod
+ def get_sortable_column(column, _=None):
+ return getattr(column, 'dt_sortable', None)
+
+ @staticmethod
def get_column_type(column, _=None):
return getattr(column, 'dt_sort_type', None)
@@ -215,6 +220,8 @@
checker = None
permission = None
+ dt_sortable = 'false'
+
def renderCell(self, item):
if not self.has_permission(item):
return ''