Can the id of scheduler events be a string?

7 posts, 1 answers
  1. Shane
    Shane avatar
    8 posts
    Member since:
    Dec 2017

    Posted 09 Jan Link to this post

    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

  2. Answer
    Eduardo Serra
    Admin
    Eduardo Serra avatar
    106 posts

    Posted 09 Jan Link to this post

    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.
  3. Shane
    Shane avatar
    8 posts
    Member since:
    Dec 2017

    Posted 09 Jan in reply to Eduardo Serra Link to this post

    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"}
                                    }
                                }
                            }

  4. Shane
    Shane avatar
    8 posts
    Member since:
    Dec 2017

    Posted 09 Jan in reply to Shane Link to this post

    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

  5. Eduardo Serra
    Admin
    Eduardo Serra avatar
    106 posts

    Posted 10 Jan Link to this post

    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.
  6. Shane
    Shane avatar
    8 posts
    Member since:
    Dec 2017

    Posted 11 Jan Link to this post

    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?

  7. Shane
    Shane avatar
    8 posts
    Member since:
    Dec 2017

    Posted 11 Jan in reply to Shane Link to this post

    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

     

  8. Shane
    Shane avatar
    8 posts
    Member since:
    Dec 2017

    Posted 11 Jan in reply to Shane Link to this post

    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 :-)

     


Back to Top