jQuery UI Widgets Forums Angular update data from the server:jqxscheduler

This topic contains 2 replies, has 2 voices, and was last updated by  KevinMbitkebeyo 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • update data from the server:jqxscheduler #122585

    KevinMbitkebeyo
    Participant

    Hello please I have a prolem. I can’t change the data of my server from the scheduler. Here is the code I used to do it:

    myAppointmentChange(item: any): void {
    let appointment = item.args.appointment;

    const singleEvent: CalendarInterface = {
    event: null,
    locationId: this.locality,
    startdate: null,
    enddate: null,
    month: null,
    year: null,
    };
    singleEvent.id = appointment.originalData.id;
    singleEvent.event = appointment.subject;
    singleEvent.startdate = appointment.originalData.start;
    singleEvent.enddate = appointment.originalData.end;
    singleEvent.month = this.date.month();
    singleEvent.year = this.date.year();
    this.calService.update(singleEvent).subscribe(
    (data) => {
    this.openSnackBar(“L’évènement a bien été mis à jour.”);
    console.log(data);
    },
    (error) => {
    console.log(error);
    },
    );
    }

    the id I get is of type string and does not match the one in my server which is of type number. What to do please?

    I have looked at similar posts to this one but unfortunately I have not found a solution to my problem.

    update data from the server:jqxscheduler #122592

    ivanpeevski
    Participant

    Hi KevinMbitkebeyo,

    If the ids in your server are just indexes like 1, 2, 3,… and an item in your source looks something like this:

    {
        "id": 1,
        "isActive": true,
        "status": "busy",
        "name": "Mollie Langley",
        "style": "#0069A5",
        "about": "Message",
        "start": "2016-11-26 12:30",
        "end": "2016-11-26 17:30"
    },

    Then you need just to set { name: 'id', type: 'number' } in source->datafields

    Best regards,
    Ivan Peevski

    jQWidgets Team
    https://www.jqwidgets.com

    update data from the server:jqxscheduler #122596

    KevinMbitkebeyo
    Participant

    Hi, I have already tried this method you propose and it works very well. The problem is that I would like to update the data from the scheduler form. The default id I get is a string. When I do a console.log of the data I get this is what I get:

    {subject: ‘yuzey’, description: ”, start: Fri Sep 30 2022 00:00:00 GMT+0200 (heure d’été d’Europe centrale), end: Fri Sep 30 2022 23:59:59 GMT+0200 (heure d’été d’Europe centrale), id: ‘1821-26-19-30-25’}

    As you can see the id is a string and I would like to change it with the server id directly. How to do this please?

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.