Skip to content

burnbright/silverstripe-listeditor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SilverStripe List Editor

A light-weight front-end control for adding, editing, and deleting DataObjects in a given DataList.

Usage

Update your DataObject as follows:

  • Implement/extend the getFrontEndFields method to control form fields.
  • Implement/extend the 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());
}
?>

Customising the template

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.

Troubleshooting

Add CRUD functions to your DataObject

Make sure you implement the canCreate and canEdit and canDelete functions on your dataobject.

Add/edit form redirects back without saving any changes

You may have fields added that are failing validation. All fields are required by default in the ListEditForm.

About

Front-end DataList create/edit/delete control.

Resources

Stars

Watchers

Forks

Packages

No packages published