src/pyams_content/component/association/zmi/__init__.py
changeset 175 fb51fb6d6129
parent 165 2912fbd45f62
child 199 d82d8670735e
equal deleted inserted replaced
174:3e6b4514cacb 175:fb51fb6d6129
    59     def get_ajax_output(self, changes):
    59     def get_ajax_output(self, changes):
    60         associations_table = AssociationsTable(self.context, self.request)
    60         associations_table = AssociationsTable(self.context, self.request)
    61         associations_table.update()
    61         associations_table.update()
    62         return {'status': 'success',
    62         return {'status': 'success',
    63                 'message': self.request.localizer.translate(_("Association was correctly added.")),
    63                 'message': self.request.localizer.translate(_("Association was correctly added.")),
    64                 'callback': 'PyAMS_content.associations.afterUpdateCallback',
    64                 'events': [{
    65                 'options': {'parent': associations_table.id,
    65                     'event': 'PyAMS_content.changed_item',
    66                             'table': associations_table.render()}}
    66                     'options': {'object_type': 'associations',
       
    67                                 'object_name': associations_table.id,
       
    68                                 'table': associations_table.render()}
       
    69                 }]}
    67 
    70 
    68 
    71 
    69 class AssociationItemAJAXEditForm(AJAXEditForm):
    72 class AssociationItemAJAXEditForm(AJAXEditForm):
    70     """Association item properties edit form, JSON renderer"""
    73     """Association item properties edit form, JSON renderer"""
    71 
    74 
    73         target = get_parent(self.context, IAssociationTarget)
    76         target = get_parent(self.context, IAssociationTarget)
    74         associations_table = AssociationsTable(target, self.request)
    77         associations_table = AssociationsTable(target, self.request)
    75         associations_table.update()
    78         associations_table.update()
    76         return {'status': 'success',
    79         return {'status': 'success',
    77                 'message': self.request.localizer.translate(self.successMessage),
    80                 'message': self.request.localizer.translate(self.successMessage),
    78                 'callback': 'PyAMS_content.associations.afterUpdateCallback',
    81                 'events': [{
    79                 'options': {'parent': associations_table.id,
    82                     'event': 'PyAMS_content.changed_item',
    80                             'table': associations_table.render()}}
    83                     'options': {'object_type': 'associations',
       
    84                                 'object_name': associations_table.id,
       
    85                                 'table': associations_table.render()}
       
    86                 }]}
    81 
    87 
    82 
    88 
    83 #
    89 #
    84 # Content associations view
    90 # Content associations view
    85 #
    91 #