jQuery UI Widgets Forums Angular Scheduler Resource not update

This topic contains 6 replies, has 2 voices, and was last updated by  Henley 2 months, 1 week ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • Scheduler Resource not update #111826

    Henley
    Participant

    Hi Admin,

    I’m trying to pull the data from server and update the data once completed. I manage to refresh the scheduler with the latest data from my json but resources from the legend not showing. May i know which part i have miss out? Thanks~

    ngOnInit() {
    this.GetEventList();
    }

    GetEventList() {
    this.eventService.GetEventList()
    .subscribe(
    data => {
    data.forEach(element => {
    this.lstEvent.push({
    id: element.EventID,
    description: element.Description,
    location: element.Location,
    subject: element.Subject,
    calendar: element.OwnerName,
    start: new Date(element.StartDate),
    end: new Date(element.EndDate)
    })
    });

    this.source.localData = this.lstEvent;
    this.dataAdapter = new jqx.dataAdapter(this.source);
    },
    error => console.log(error)
    )
    }

    source: any =
    {
    dataType: “array”,
    dataFields: [
    { name: ‘id’, type: ‘string’ },
    { name: ‘description’, type: ‘string’ },
    { name: ‘location’, type: ‘string’ },
    { name: ‘subject’, type: ‘string’ },
    { name: ‘calendar’, type: ‘string’ },
    { name: ‘start’, type: ‘date’ },
    { name: ‘end’, type: ‘date’ }
    ],
    id: ‘id’,
    localData: this.lstEvent
    };
    dataAdapter: any = new jqx.dataAdapter(this.source);
    date: any = new jqx.date(2020, 4, 25);
    appointmentDataFields: any =
    {
    from: “start”,
    to: “end”,
    id: “id”,
    description: “description”,
    location: “location”,
    subject: “subject”,
    resourceId: “calendar”
    };
    resources: any =
    {
    colorScheme: “scheme05”,
    dataField: “calendar”,
    source: new jqx.dataAdapter(this.source)
    };
    views: any[] =
    [
    ‘dayView’,
    ‘weekView’,
    ‘monthView’
    ];

    Scheduler Resource not update #111829

    Hristo
    Participant

    Hello Henley,

    You could determinate the resources before using the initial data.
    I would like to suggest you look at another topic in our forum:
    https://www.jqwidgets.com/community/topic/call-render-method-from-vue/
    It is for Vue but you could try to use the same approach for you in Angular.
    Also, I would like to suggest you to use the setOptions method to update the source property.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

    Scheduler Resource not update #111837

    Henley
    Participant

    Hi Histro,

    Can i say that i should pulling the data and bind it to the adapter first then only render the scheduler to create? Besides, when should I call set setOptions method from the code above? Hope you can provide some guides from here. Thanks a lots

    Scheduler Resource not update #111842

    Hristo
    Participant

    Hello Henley,

    I only provide you an option on how to set the “Rooms” by default.
    When you fetch the data you could use the setOptions method to set the new DataAdapter.
    Please, let me know if you have trouble with this.
    Also, it will be better if you could provide one full example.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

    Scheduler Resource not update #111858

    Henley
    Participant

    Hi Hristo,

    Thanks for the suggestion and I manage to make it this scheduler work well. But i have one more question to ask. I’m trying to switch the localization data base on the language selected. I have the local json file with all the localization values and how can i set the localization update ask the scheduler to reflect the changes? I have tried to user destroy method and recreate the component again but the scheduler not showing after destroy. Thanks in advance.

    • This reply was modified 2 months, 2 weeks ago by  Henley.
    Scheduler Resource not update #111870

    Hristo
    Participant

    Hello Henley,

    I would like to suggest you destroy the component and create it again with the desired localization object.
    There is one more option but it is a little bit more complex and I cannot guarantee because it is not tested enough.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com

    Scheduler Resource not update #111876

    Henley
    Participant

    Hello Hristo,

    Thank you so much for your help and the suggestion given. Have a nice day ^^

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

You must be logged in to reply to this topic.