1

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.

4

1 回答 1

0

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

但这使用 AJAX 添加条目。

于 2012-10-30T11:35:27.933 回答