Skip to content

Conversation

@JulianDroog
Copy link
Contributor

Added functionality for using custom link formatters

Example:

[
 'url' => ['action' => 'view', 'extra' => ("/' + obj.id + '")],
 'label' => '<i class="fa fa-long-arrow-alt-up mx-1" onclick="modalView(obj.id)" data-bs-toggle="modal" data-modal type="modal-xl" ></i>',
 'type' => \CakeDC\Datatables\Datatables::LINK_TYPE_CUSTOM,
 'formatter' => CustomFormatter::class,
],

@JulianDroog JulianDroog requested a review from steinkel September 1, 2022 09:09
}
$output = new $link['formatter']($this,$link);

if (method_exists($output, 'link')){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing ! as we need to throw exception if the link method does not exist

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied it wrong, my bad

@JulianDroog JulianDroog requested a review from steinkel September 1, 2022 09:29
@steinkel steinkel merged commit 54d3e02 into CakeDC:1.next-cake4 Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants