Skip to content
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

Replace click action for custom buttons with non-JSON encoded values #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

coupej
Copy link

@coupej coupej commented Feb 8, 2016

When trying to set customButtons
(http://fullcalendar.io/docs/display/customButtons/) via the options
array the click button didn’t work cause it was JSON-encoded. This code
replaces the JSON encoded version with the original code that was
provided in the options array.

When trying to set customButtons
(http://fullcalendar.io/docs/display/customButtons/) via the options
array the click button didn’t work cause it was JSON-encoded. This code
replaces the JSON encoded version with the original code that was
provided in the options array.
@TimoStahl
Copy link

Please merge this PR, I've got the same "problem".

@poxxac
Copy link

poxxac commented Jan 7, 2018

I tried this but didn't show the button, any example? Thanks so much

Copy link

@me-cedric me-cedric left a comment

Choose a reason for hiding this comment

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

This is still not on the laravel 4 branch, it is very usefull.

@ghost
Copy link

ghost commented May 11, 2018

Here's the example! First - use coupej's patch in composer.json:

"repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/coupej/laravel-fullcalendar"
        }
    ],
    "require": {
        "maddhatter/laravel-fullcalendar": "dev-master",
    }

After "composer update", replaceClickCustomButtons should be found in Calendar.php. If thats successful, update your calendar options:

$calendar = \Calendar::setOptions([
            'firstDay' => 1,
            'events' => '/calendar/events',
            'defaultView' => 'month',
            'weekNumbers' =>  true,
            'weekNumbersWithinDays' => true,
            'locale' => 'de',
            'themeSystem' => 'bootstrap4',
            'selectable' => true,
            'header' => [
                'left' => 'prev,next today B1',
            ],
            'customButtons' => [
                'B1' => [
                    'text' => 'button1',
                    'click' => 'function () { alert("clicked button1"); }'
                 ],
            ]
        ])

@SidAliCrenier
Copy link

¡Thank you very much! I has this exact same problem I couldn't find a workaround. ¡Thanks!

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.

5 participants