list.overrideRecordAction for Backend Relations Manager ListWidget

I’m using OctoberCMS version 2 and need to override onclick url for my hasMany relations manager. From what described in backend.list.overrideRecordAction API documentation, I can override the record url in a ListWidget. It works, but not with ListWidget that use by Relations Manager.

Is this possible to overrides the record url in a list widget of relations manager?

Hi @yfktn

Sure, you can extend the relation manager widget’s using these overrides in the controller

/**
 * relationExtendViewWidget provides an opportunity to manipulate the view widget.
 * @param Backend\Classes\WidgetBase $widget
 * @param string $field
 * @param \October\Rain\Database\Model $model
 */
public function relationExtendViewWidget($widget, $field, $model)
{
}

/**
 * relationExtendManageWidget provides an opportunity to manipulate the manage widget.
 * @param Backend\Classes\WidgetBase $widget
 * @param string $field
 * @param \October\Rain\Database\Model $model
*/
public function relationExtendManageWidget($widget, $field, $model)
{
}

The $widget->bindEvent() can then be used called on the list widget.

1 Like

Thank you @daft, it works.