Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I am working on syncfusion scheduler and I tried to bind data in different ways as they are mentioned in documentation.

I have followed the all steps for data binding ,tried my hand with different adaptors, also passed the same properties as passed by syncfusion apis. But I am still unable to bind data.

Using asp.net core for apis and angular 7 with mongodb database

What I have tried:

I have tried following:-
Web Api method:-
  [HttpPost("GetCalls")]
       // [Produces("application/xml")]
        public JsonResult GetCalls()
        {
           
            DefaultSchedule schedulerModel = new DefaultSchedule();
            schedulerModel.RecurrenceRule = new RecurrenceRule();
            schedulerModel.AllDay = false;
            schedulerModel.Categorize = new List<string>(new string[] { "1", "2" });
            schedulerModel.CustomStyle = "";
            schedulerModel.Description = "";
            schedulerModel.EndTime = DateTime.Today.AddDays(3);
            schedulerModel.EndTimezone = "";
            schedulerModel.Id = 100;
            schedulerModel.Location = "chn";
            schedulerModel.Owner = 1;
            schedulerModel.Priority = "";
            schedulerModel.Recurrence = null;
            schedulerModel.RecurrenceEndDate = null;
            schedulerModel.RecurrenceRule.FREQ = "DAILY";
            schedulerModel.RecurrenceRule.INTERVAL = 2;
            schedulerModel.RecurrenceRule.COUNT = 1;
            schedulerModel.RecurrenceStartDate = null;
            schedulerModel.RecurrenceType = null;
            schedulerModel.RecurrenceTypeCount = null;
            schedulerModel.Reminder = true;
            schedulerModel.StartTime = DateTime.Today.AddDays(2);
            schedulerModel.StartTimeZone = null;
            schedulerModel.Subject = "Bering Sea Gold";
            return new JsonResult(schedulerModel);
        }

For client side I have tried in Angular 6 :-
export class SchedulerComponent  {
  public selectedDate: Date;
  public currentView: View;
  private dataManager: DataManager;
  public eventSettings: EventSettingsModel;
  constructor() {
    console.log("today", new Date());
    this.getResults();
  }
  async getResults() {
    let expectedResults = await this.UpdateScheduler();
    let setResults = await this.setValues();
    console.log("expectedResults", expectedResults);
    console.log("setResults", setResults);
  }


  //new check code
  UpdateScheduler() {
    this.selectedDate = new Date();
    this.currentView = 'Month';
    this.dataManager = new DataManager({
      url: 'https://localhost:44369/api/Scheduler/GetCalls',
      adaptor: new WebMethodAdaptor,
      crossDomain: true
    });
  }

  setValues() {
    debugger
    console.log("dataManagerValue", this.dataManager);
    this.eventSettings = { dataSource: this.dataManager };
  }
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900