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

Resource getParent() returns undefined from select callback #7023

Closed
zhangjett opened this issue Nov 7, 2022 · 5 comments
Closed

Resource getParent() returns undefined from select callback #7023

zhangjett opened this issue Nov 7, 2022 · 5 comments
Assignees
Labels
Date Point/Select Date (and Time) selection with mouse, or other mouse actions over dates like hovering Reproducing Resource Model
Milestone

Comments

@zhangjett
Copy link

Reduced Test Case

https://codepen.io/zhangjett/pen/XWYjoPW?editors=001

Bug Description

Attempting to access a Resource's parent attribute in date select event。
cause error {_context: {…}, _resource: undefined}

https://github.com/fullcalendar/fullcalendar-scheduler/blob/776453a55aedb31f853d669beb36a49f98f887fa/resource-common/src/api/ResourceApi.ts#L89

Change resourceSource to resourceStore is right?

Screenshots

1667800155566

@acerix acerix changed the title parent resource undefined in date select event Resource getParent() returns undefined from select callback Nov 7, 2022
@acerix acerix added Confirmed Date Point/Select Date (and Time) selection with mouse, or other mouse actions over dates like hovering Resource Model labels Nov 7, 2022
@arshaw
Copy link
Member

arshaw commented Dec 5, 2022

@zhangjett , when I use your demo, when selecting dates on a top-level resource, the console correctly outputs null. This happens on resources like Resource A/B/C. However, when selecting a nested resource like D1/D2, a parent is correctly outputted.

Top-level resources don't have parent resources. Only nested resources do. Does that make sense? Am I understanding your bug report correctly?

@zhangjett
Copy link
Author

When selecting a nested resource like D1/D2, a parent is incorrectly outputted. All values is undefined. Thanks!:blush:
1670945316039

@forum1901
Copy link

I am having the same issue. Is there any work around ? I do nned the feature for my project. Thanks.

@Muukuro
Copy link

Muukuro commented Feb 21, 2023

In ResourceApi.getParent(), a new ResourceApi is constructed. I believe the second argument (resource) is retrieved incorrectly, because the resource key-value pairs are stored in resourceStore, not in resourceSource.

@arshaw arshaw added this to the upcoming-release milestone Mar 6, 2023
@arshaw
Copy link
Member

arshaw commented Mar 21, 2023

Fixed in v6.1.5

Updated repro: https://codepen.io/arshaw/pen/PodyQwB?editors=001

@arshaw arshaw closed this as completed Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Date Point/Select Date (and Time) selection with mouse, or other mouse actions over dates like hovering Reproducing Resource Model
Projects
Archived in project
Development

No branches or pull requests

5 participants