-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a way to set a route instead of the absolute link in a select or action column #270
Conversation
added phpoffice/phpexcel and tecnickcom/tcpdfin require-dev fixxed case-sensitive error in `ZfcDatagrid\Renderer\TCPDF`
… or action column. See ThaDafinser#268
src/ZfcDatagrid/Datagrid.php
Outdated
*/ | ||
public function hasRouter() | ||
{ | ||
return !is_null($this->translator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@halfpastfouram wrong variable
src/ZfcDatagrid/PrepareData.php
Outdated
&& $this->getRouter() instanceof RouteStackInterface | ||
) { | ||
/** @var Column\Formatter\RouterInterface */ | ||
$formatter->setRouter($this->getrouter()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@halfpastfouram method lower case
All of the builds in travis fail because of "Your requirements could not be resolved to an installable set of packages.". Something is up with the composer requirements, but this does not seem to be caused by my edits. |
@halfpastfouram the In the other there are some https://travis-ci.org/ThaDafinser/ZfcDatagrid/jobs/201881803#L328 |
@halfpastfouram after the cs issues are resolved, i'm going to fix the resolve issue. In general i would say the PR LGTM - a small improvement would be a |
@ThaDafinser I agree with you on the trait and interface. Would indeed be an improvement, but haven't had the time to implement that yet. I could improve it a bit in a later stage. Right now I can't wait until this is implemented because it's gonna make my life/job so much easier. What do you mean exactly by the cs issues? Is there anything you need me to do? |
@halfpastfouram i will fix it for you in your PR, since you don't know it (later this day) It's just coding style violations |
merged to Thank you! 👍 |
Solution for issue #268.
Solution for Action Button
I've used the ZF2 view helper URL inside
ZfcDatagrid\Renderer\BootstrapTable\View\Helper\TableRow
since that is already a view helper itself. If you've got a router setup this works out of the box.You can now do the following:
Solution for Select Column
Set the router you want to use in the Datagrid:
Then set a route on a link formatter and provide that formatter to the column: