--- a/src/pyams_skin/table.py Wed Jun 27 14:59:27 2018 +0200
+++ b/src/pyams_skin/table.py Wed Jun 27 15:00:54 2018 +0200
@@ -162,6 +162,16 @@
render = get_view_template()
+ def getSelectedRowClass(self, row, cssClass=None):
+ klass = self.cssClasses.get('tr.selected')
+ if callable(klass):
+ klass = klass(*row)
+ if klass and cssClass:
+ klass = '{0} {1}'.format(klass, cssClass)
+ elif cssClass:
+ klass = cssClass
+ return klass or ''
+
def renderTable(self):
return super(BaseTable, self).renderTable() \
.replace('<table', '<table %s' % self.get_data_attributes('table', self))
@@ -174,6 +184,7 @@
request=self.request)
def renderRow(self, row, cssClass=None):
+ cssClass = self.getSelectedRowClass(row[0], cssClass)
return super(BaseTable, self).renderRow(row, cssClass) \
.replace('<tr', '<tr %s' % self.get_data_attributes('tr', row[0][0]))