z3c.form and Javascript subform CRUD widget for Plone

392 Views Asked by At

I need a widget which has add/remove of subforms via Javascript (create-read-update-delete).

It would be similar to DataGridField, but instead of having lines it would present subforms as blocks.

A jQuery plug-in example: http://vipullimbachiya.com/jQuery/Plugins/MultiField/SampleMultiField.htm#example

Does z3c.form or Plone has this kind of subform CRUD widgets already? The main thing would be implement this 100% on the client side, without HTTP postback when you press add/remove buttons.

1

There are 1 best solutions below

2
On

There is plone.z3cform.crud / plone.app.z3cform.crud:

class IOneEntry(interface.Interface):
    # Schema definition

class MainForm(crud.CrudForm):
    update_schema = IOneEntry

    def get_items(self):
        # return items implementing IOneEntry

    def add(self, data):
        # Add one IOneEntry object

    def remove(self, (id, data)):
        # Remove one IOneEntry object

but this does not use AJAX to add entries.