Comments (1)
Actually the solution for this was rather simple and I had had overridden the drag and drop event here - https://github.com/saade/filament-fullcalendar/blob/3.x/src/Widgets/Concerns/InteractsWithEvents.php
Originally the documentation assumes there is just one Model type Event
. Having more than one Model type and having some custom code to parse the events and save them works much better.
This is what I had ended up using.
public function onEventDrop(array $event, array $oldEvent, array $relatedEvents, array $delta): bool
{
$model = null;
switch ($event['extendedProps']['calendar_type']) {
case 'job':
$model = Job::findOrFail($event['id']);
$model->deadline_date = Carbon::parse($event['end']);
break;
case 'job-task':
$model = JobTask::findOrFail($event['id']);
if ($event['end']) {
$model->end_date = Carbon::parse($event['end']);
}
break;
}
$model->start_date = Carbon::parse($event['start']);
$model->save();
return false;
}
from filament-fullcalendar.
Related Issues (20)
- Exception Plugin [filament-fullcalendar] is not registered for panel [app]. HOT 3
- When editing a field is not disabled with disabled() property
- Model labels not working HOT 1
- Typed property Saade\FilamentFullCalendar\Widgets\FullCalendarWidget::$record must not be accessed before initialization HOT 2
- Strange bug, while returning array of EventData HOT 2
- Calendar Events not showing HOT 2
- eventDidMount doesn't work
- Option 'config' in 'AdminPanelProvider' overrides the 'config' method of the widget. HOT 7
- No dispatch events when use filament-fullcalendar--goto HOT 5
- It doesn't work if you add a plugin HOT 2
- The previous month's event does not carry over to the next month. HOT 7
- The fetchEvents not being refreshed HOT 1
- onDateSelect not triggerd (CreateForm not opened) HOT 3
- events not captured after months change HOT 2
- Argument #2 ($record) - null given HOT 3
- Installation failed on a fresh Laravel v.11 HOT 2
- [V4] Please file your Feature Request here :) HOT 4
- CreateAction and default value
- Conflicting $record when using widget in a resource HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from filament-fullcalendar.