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

Added the ability to return active grid data and view #138

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,17 @@ protected function headerActions(): array

Follow the [Filament Docs](https://filamentphp.com/docs/3.x/widgets/adding-a-widget-to-a-blade-view) to know how to add the widget to a Blade view.

## Return active grid data

You can get the currently active grid data and view using the function `getActiveGrid($data))`. For more information about the contents of the parameter, visit [FullCalendar Docs](https://fullcalendar.io/docs/datesSet)

```php
public function getActiveGrid($data)
{
// Up to you
}
```

## Share your tricks

If you have any tricks that you want to share, please open a PR and add it to this section.
Expand Down
22,829 changes: 22,818 additions & 11 deletions dist/filament-fullcalendar.js

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions resources/js/filament-fullcalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ export default function fullcalendar({
revert()
}
},
datesSet: async({
start: s,
end: e,
startStr: ss,
endStr: es,
timeZone: t,
view: v
}) => {
await this.$wire.getActiveGrid({start: s,end: e, startStr: ss, endStr: es, timeZone: t, view: v})
},
eventResize: async ({ event, oldEvent, relatedEvents, startDelta, endDelta, revert }) => {
const shouldRevert = await this.$wire.onEventResize(event, oldEvent, relatedEvents, startDelta, endDelta)

Expand Down
5 changes: 5 additions & 0 deletions src/Widgets/Concerns/InteractsWithEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,9 @@ protected function calculateTimezoneOffset(string $start, ?string $end, bool $al

return [$start, $end, $allDay];
}

public function getActiveGrid($data){

return $data;
}
}