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

CalendarEvent Id #418

Closed
masrc opened this issue Nov 23, 2017 · 21 comments
Closed

CalendarEvent Id #418

masrc opened this issue Nov 23, 2017 · 21 comments
Assignees

Comments

@masrc
Copy link

masrc commented Nov 23, 2017

Did you verify this is a real problem by searching Stack Overflow?

Yes

Tell us about the problem

I have a calendar that can show, create, edit and remove events, they are being saved on a array and its working at now, but I need save that in a data base, so I need a CalendarEvent Id. If that exist arready, how can I access? If not, do you recommend any way to implemented this?

@NickIliev
Copy link
Collaborator

@masrc thank you for your interest in NativeScript pro ui suite.
Indeed at this very moment, calendar event ID is not implemented out-of-the-box for RadCalendar so I am marking this one as a feature request.

Regarding on how to work around your issue - I guess storing a mirror array with the event items (+ unique ID for each item) in your view model is an option. Then when you need to save the event, lookup up for the unique ID in the mirror array and use it to store and retrieve the data when needed.

@felipebueno
Copy link

felipebueno commented Jan 16, 2018

Hi, @NickIliev!

I'm facing the same issue as @masrc.

For now I'm comparing the returned event from my onDayViewEventSelected(args: CalendarDayViewEventSelectedData) function with the items stored on an array using event.title + event.startDate + event.endDate as the unique id.

Please, allow us to associate custom data to a CalendarEvent! 😢

View

<calendar:RadCalendar eventSource="{{ eventSource }}" dayViewEventSelected="onDayViewEventSelected" />

Code behind

export function onDayViewEventSelected(args: CalendarDayViewEventSelectedData) {
    const event: CalendarEvent = args.eventData;
    const bookingId = event.title + event.startDate + event.endDate;
    home.onDayViewEventSelected(bookingId);
}

ViewModel

    onDayViewEventSelected(bookingId: string) {
        // Temporary solution to find the booking associated with the tapped event
        // as there's no way to set custom data on a CalendarEvent object yet
        // REFERENCE:
        // https://www.telerik.com/forums/custom-data-in-calendarevent
        // https://github.com/telerik/nativescript-ui-feedback/issues/418
        const booking = this._bookings.find((_booking) => {
            return _booking.title + _booking.start_date + _booking.end_date === bookingId;
        });
        frameModule.topmost().navigate({
            moduleName: "bookings/booking-detail-page/booking-detail-page",
            context: booking,
            animated: true
        });
    }

@jvelezc
Copy link

jvelezc commented Feb 22, 2018

Same problem please let us have something so we can store the unique id. +1

@horeyes
Copy link

horeyes commented Feb 22, 2018

Hello @NickIliev,

I'm facing the same issue. Having access to an Id would give the calendar more functionality.

Thanks

@tonyawad88
Copy link

Hello,

Is it possible to do a pull request on the nativescript pro ui?

I can try and help out if you let me know which telerik project I should use / branch of.

Cheers,
Tony

@radeva
Copy link
Contributor

radeva commented Mar 16, 2018

Hi @tonyawad88 ,

The components now are free but still not open-source so I'm afraid this is currently not possible. We're working in direction of open-sourcing them so once this happen it will be possible.

Best regards,
Vesi

@rickdps
Copy link

rickdps commented Jul 16, 2018

Hi everyone. I really need this functionality. Please, help us.

@throwingdarts
Copy link

throwingdarts commented Aug 8, 2018

I am really surprised this is not already possible. Seems like such basic functionality. Why have a list of data objects (in this case in a calendar view) without any way to know what data object the user selected? PLEASE make this a priority so this calendar control is actually usable. Personally it may force me to switch to Xamarin :-(

@felipebueno
Copy link

felipebueno commented Aug 8, 2018

Hi, @throwingdarts!

You could try the workaround I described on my comment.

I know it's not great but it should work for now.

@throwingdarts
Copy link

Thanks @felipebueno,

I appreciate that but your work-a-round only works if the constructed bookingId is unique. In my case I could have multiple all-day events with the same title.

@nativoplus
Copy link

Same problem... Is 2018 now.

@lukebellamy053
Copy link

I must say it's pretty appalling that this was never added in the first place. It's a very simple feature, without which severely limits the use of the calendar. Please sort this out as soon as you can or provide a reasonable workaround that isn't just checking the attributes

@phatakrajan
Copy link

Is it possible to extend the class and register element? Just random idea ....

@radeva
Copy link
Contributor

radeva commented Oct 25, 2018

Hi @tonyawad88 , @phatakrajan, @lukebellamy053, @nativoplus, @rickdps , @felipebueno, @throwingdarts

Contributions are now possible after signing a mutual NDA. If you or anyone else is still interested to contribute, contact us at nativescriptplugins@progress.com.

@BernaLang
Copy link

Any update on this?

@Remigius2011
Copy link

hi,

disclaimer: this is just a "me too" comment - due to the fact that we face the same problem and that nothing has appened in quite some time.

imho it should not be a big issue to add either an additional field to CalendarEvent that is passed to the event handler. The additional field should be of type any - this would give the user the freedom to either use an id or the data object itself.

the work-around of concatenating some fields of the calendar events is indeed a work-around, but even if there are no collisions (of which you can never be sure in this case), associating the objects directly to the calendar event is in any case more efficient.

@throwingdarts
Copy link

throwingdarts commented Apr 23, 2019

@radeva I would love to learn to contribute but am afraid my learning curve would be too time consuming for me at this point. Any update here?

@tgpetrov tgpetrov self-assigned this Jun 13, 2019
@tgpetrov
Copy link
Contributor

Hi all,
Currently RadCalendar's eventSource should be a list of items of type CalendarEvent.
We are planning to add the option to extend the CalendarEvent class and allow you to pass a list of items of your custom type as eventSource. This way you will be able to add whatever you need to store in the events including an id of the type that is most convenient for you.

@elena-p elena-p added this to Inbox in Plugins Team via automation Jun 14, 2019
@elena-p elena-p moved this from Inbox to In Progress in Plugins Team Jun 14, 2019
@tgpetrov tgpetrov moved this from In Progress to Review / QA in Plugins Team Jun 18, 2019
@zbranzov zbranzov self-assigned this Jun 25, 2019
@zbranzov zbranzov moved this from Review / QA to Ready for Release in Plugins Team Jun 25, 2019
@zbranzov
Copy link
Contributor

Released in nativescript-ui-calendar@4.1.0

Plugins Team automation moved this from Ready for Release to Done Jun 26, 2019
@tgpetrov
Copy link
Contributor

Here's more info about how to extend the calendar event:

@rosen-vladimirov rosen-vladimirov removed this from Done in Plugins Team May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests