Document widget accepted config
These definitions don't serve a function other than helping developers
This commit is contained in:
parent
3524b17484
commit
5784417862
|
|
@ -13,14 +13,14 @@ use Session;
|
|||
*/
|
||||
abstract class WidgetBase
|
||||
{
|
||||
use \System\Traits\ViewMaker;
|
||||
use \System\Traits\AssetMaker;
|
||||
use \System\Traits\ConfigMaker;
|
||||
use \System\Traits\ViewMaker;
|
||||
use \Backend\Traits\WidgetMaker;
|
||||
use \October\Rain\Support\Traits\Emitter;
|
||||
|
||||
/**
|
||||
* @var array Supplied configuration.
|
||||
* @var object Supplied configuration.
|
||||
*/
|
||||
public $config;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,23 @@ use October\Rain\Database\Model;
|
|||
*/
|
||||
class Form extends WidgetBase
|
||||
{
|
||||
/**
|
||||
* @var array Expected configuration:
|
||||
*
|
||||
* - fields: outside form field definitions
|
||||
* - tabs: primary tab form field definitions
|
||||
* - secondaryTabs: secondary tab form field definitions
|
||||
* - arrayName: a HTML array name to use for each element
|
||||
* - context: apply a context to this form and its fields
|
||||
*/
|
||||
public $config = [
|
||||
'fields' => [],
|
||||
'tabs' => [],
|
||||
'secondaryTabs' => [],
|
||||
'arrayName' => null,
|
||||
'context' => null,
|
||||
];
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -25,6 +25,37 @@ use DateTime;
|
|||
*/
|
||||
class Lists extends WidgetBase
|
||||
{
|
||||
/**
|
||||
* @var array Expected configuration:
|
||||
*
|
||||
* - columns: list column definitions
|
||||
* - model: object or class name, data is loaded from this model
|
||||
* - recordUrl: link each list record to another page
|
||||
* - recordOnClick: custom JavaScript code to execute when clicking on a record
|
||||
* - noRecordsMessage: a message to display when no records are found
|
||||
* - recordsPerPage: records to display per page, use 0 for no pages
|
||||
* - showSorting: displays the sorting link on each column
|
||||
* - defaultSort: sets a default sorting column and direction
|
||||
* - showCheckboxes: displays checkboxes next to each record
|
||||
* - showSetup: displays the list column set up button
|
||||
* - showTree: displays a tree hierarchy for parent/child records
|
||||
* - treeExpanded: if tree nodes should be expanded by default
|
||||
*/
|
||||
public $config = [
|
||||
'model' => null,
|
||||
'columns' => [],
|
||||
'recordUrl' => null,
|
||||
'recordOnClick' => null,
|
||||
'noRecordsMessage' => null,
|
||||
'recordsPerPage' => 0,
|
||||
'showSorting' => true,
|
||||
'defaultSort' => ['column' => null, 'direction' => null],
|
||||
'showCheckboxes' => false,
|
||||
'showSetup' => false,
|
||||
'showTree' => false,
|
||||
'treeExpanded' => false,
|
||||
];
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue