This is a migrated thread and some comments may be shown as answers.

Can the id of scheduler events be a string?

7 Answers 365 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Shane
Top achievements
Rank 1
Shane asked on 09 Jan 2018, 06:56 PM

Or can it only be a number? We use GUIDs for all our identifiers so it'd be nice to be able to use a string for an id of the events in the scheduler

This would allow us to do things like mix different types onto a scheduler since we have globally unique ids

7 Answers, 1 is accepted

Sort by
0
Accepted
Eduardo Serra
Telerik team
answered on 09 Jan 2018, 07:32 PM
Hello Shane,

You can definitely use a GUID as the id of a scheduler event, as it allows for either a string, a number, or an object.

You can find the API Reference for the Kendo SchedulerEvent in our documentation here.

I hope this helps!

Regards,
Eduardo Serra
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Shane
Top achievements
Rank 1
answered on 09 Jan 2018, 08:08 PM

Hmmm ok yea I see that now....

There must be something else I'm doing wrong then.

Whenever I use a string for the ID then the ID field just comes across as null whenever I edit the SchedulerEvent. Then I'd change it back to a number and it would no longer be null.

Like if I set the id to "1" then I get a "1" when the update on the data source is called but if I set it to like "cat" then it's just null on the data that's posted to the server

I even set the type to string in the schema

schema:
                        {
                            model:{
                                id: "id",
                                fields: {
                                    id: {from: "id", type: "string"}
                                }
                            }
                        }

0
Shane
Top achievements
Rank 1
answered on 09 Jan 2018, 08:18 PM

alright it doesn't like me calling it "id" I guess

I changed the field on my data structure to be called "Identifier" then mapped that to "id"

 

schema:
                        {
                            model:{
                                id: "identifier",
                                fields: {
                                    identifier: { from: "Identifier", type: "string"}
                                }
                            }
                        }

 

and now it seems to work

0
Eduardo Serra
Telerik team
answered on 10 Jan 2018, 08:27 PM
Hello Shane,

I'm glad to hear everything is now working as expected. Indeed, some words are reserved and don't play well with the API.

Regards,
Eduardo Serra
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Shane
Top achievements
Rank 1
answered on 12 Jan 2018, 12:37 AM

So then once I've mapped a different field like Identifier to Id? How can i use dataSource.GetById ?
Because now when I call datasource.getById with my string based field I always just get back undefined

I inspected the kendo model files and the id field is indeed still undefined ... So now can I just not use GetById ?? How do I pull something specific out of the data source then?

0
Shane
Top achievements
Rank 1
answered on 12 Jan 2018, 01:37 AM

I noticed GetByUID

Our ID from the server looks like this
"dbb56553-7c7f-4dc3-9128-f40e4b806b93-1714"

it looks for some reason something is lopping off that last part that's been tacked onto the guid hmmm

I'm guessing I'm just missing something obvious on my side :-p

 

0
Shane
Top achievements
Rank 1
answered on 12 Jan 2018, 01:49 AM

WAIT I get it :-p

I'm tricking myself ... You all are generating a guid which I was thinking were my guids

 

Carry on nothing to see here :-)

 


Tags
Scheduler
Asked by
Shane
Top achievements
Rank 1
Answers by
Eduardo Serra
Telerik team
Shane
Top achievements
Rank 1
Share this question
or