A light-weight front-end control for adding, editing, and deleting DataObjects in a given DataList.
Update your DataObject as follows:
getFrontEndFields
method to control form fields.canCreate
, canEdit
, and canDelete
functions to control access. see docs.Add the ListEditForm
inside your controller class:
<?php
function Form(){
return new ListEditForm($this, 'Form', Member::currentUser()->Links());
}
?>
You can make the editor template the same for a specific DataObject by adding a template named: MyDataObject_ListEditField.ss
to your project.
You could also edit on a per-instance basis by using the ListEditField's setTemplate
function.
Make sure you implement the canCreate
and canEdit
and canDelete
functions on your dataobject.
You may have fields added that are failing validation. All fields are required by default in the ListEditForm.
Module rating system helping users find modules that are well supported. For more on how the rating system works visit Module standards
Score not correct? Let us know there is a problem