--- a/src/pyams_content/shared/form/zmi/field.py Fri Jul 20 01:02:27 2018 +0200
+++ b/src/pyams_content/shared/form/zmi/field.py Fri Jul 20 12:39:19 2018 +0200
@@ -100,11 +100,18 @@
'data-ams-plugin-pyams_content-src': get_resource_path(pyams_content),
'data-ams-location': absolute_url(IFormFieldContainer(self.context), self.request),
'data-ams-tablednd-drag-handle': 'td.sorter',
- 'data-ams-tablednd-drop-target': 'set-form-fields-order.json',
- 'data-ams-visibility-switcher': 'switch-form-field-visibility.json'
+ 'data-ams-tablednd-drop-target': 'set-form-fields-order.json'
}
+ attributes.setdefault('td', {}).update({
+ 'data-ams-attribute-switcher': self.get_switcher_target
+ })
return attributes
+ @staticmethod
+ def get_switcher_target(element, column):
+ if column.__name__ == 'show-hide':
+ return 'switch-form-field-visibility.json'
+
@reify
def values(self):
return list(super(FormFieldsContainerTable, self).values)