Updated row ID function
authorThierry Florac <thierry.florac@onf.fr>
Wed, 13 Jun 2018 11:26:34 +0200
changeset 342 1aa6dded00ac
parent 341 b00ed72b170f
child 343 bff947c6b227
Updated row ID function
src/pyams_skin/table.py
--- a/src/pyams_skin/table.py	Wed Jun 13 11:26:14 2018 +0200
+++ b/src/pyams_skin/table.py	Wed Jun 13 11:26:34 2018 +0200
@@ -83,6 +83,9 @@
     def id(self):
         return get_table_id(self, self.context)
 
+    def get_element_id(self, element):
+        return '{0}::{1}'.format(self.id, ICacheKeyValue(element))
+
     title = _("Container elements")
 
     cssClasses = {'table': 'table table-bordered table-striped table-hover table-tight datatable'}
@@ -91,7 +94,7 @@
     def data_attributes(self):
         return {
             'tr': {
-                'id': lambda x, col: get_element_id(self, x),
+                'id': lambda x, col: self.get_element_id(x),
                 'data-ams-element-name': lambda x, col: get_element_name(x),
                 'data-ams-url': lambda x, col: getattr(get_element_editor(self, x), 'url', None),
                 'data-toggle': lambda x, col: 'modal' if getattr(get_element_editor(self, x), 'modal_target',