How to extend backend list columns and add custom column
2
You can add your custom column to existing backend list by extending controller with extendListColumns
method.
make sure that controller has
ListController
behaviour implemented
class Plugin extends PluginBase
{
public function boot() {
// extending Controller which has ListController Behavior
Items::extendListColumns(function($list, $model) {
// we want only our Item model be extended
if (!$model instanceof Item) {
return;
}
// adding quantity column or other new column
$list->addColumns([
'quantity' => [
'label' => 'Quantity',
'type' => 'number',
'searchable' => true
]
]);
});
}
You can add any type of column partial
or relational columns
.
Reference : How To Add New Column In October Cms List
It can be usefull when you need to show extended information with existing backend list or other 3rd party plugins.
There are no comments yet
Be the first one to comment