onSubmit: function() {
let scheduleObj = document.getElementById("Schedule").ej2_instances[0];
scheduleObj.eventSettings.dataSource = [{
Id: 1,
Subject: 'Explosion of Betelgeuse Star',
StartTime: new Date(2018, 5, 4, 9, 30),
EndTime: new Date(2018, 5, 4, 11, 0),
},
{
Id: 2,
Subject: 'Analysis',
StartTime: new Date(2018, 5, 4, 9, 30),
EndTime: new Date(2018, 5, 4, 11, 0),
}];
}
|
onSubmit: function() {
let scheduleObj = document.getElementById("Schedule").ej2_instances[0];
var dataManger = new DataManager({
url: "https://js.syncfusion.com/demos/ejservices/api/Schedule/LoadData",
adaptor: new WebApiAdaptor(),
crossDomain: true
})
.executeQuery(new Query().take(100))
.then(e => {
scheduleObj.eventSettings.dataSource = e.result;
});
} |
let data = []
export default {
data() {
return {
eventSettings: {
dataSource: data,
},
dataSource: data,
}
},
watch: {
dataSource: {
deep: true,
handler(e) {
this.eventSettings = {...this.eventSettings}
}
}
}, }
const data = [{
id: 1,
name: 'Paris',
startTime: new Date(2020, 9, 25, 1, 0),
endTime: new Date(2020, 9, 25, 2, 0),
}]
export default {
name: 'App',
data() {
return {
eventSettings: {},
}
},
mounted() {
this.$set(this.eventSettings, 'dataSource', [])
this.eventSettings.dataSource.push(...data)
}
}
let timelineResourceData = [
{
Id: 1,
Subject: "Decoding",
StartTime: new Date(2018, 1, 12, 11),
EndTime: new Date(2018, 1, 12, 13),
IsAllDay: false
}
];
export default Vue.extend({
data: function() {
return {
eventSettings: {},
selectedDate: new Date(2018, 1, 15)
};
},
provide: {
schedule: [Day, Week, WorkWeek, Month, Resize, DragAndDrop]
},
mounted() {
this.$set(this.eventSettings, 'dataSource', [])
this.eventSettings.dataSource.push(...timelineResourceData)
}
}); |
:dataBound="onDataBound" flag: true,
methods: { onDataBound: function (event) { if (this.flag) { this.$set(this.eventSettings, "dataSource", []); this.eventSettings.dataSource.push(...timelineResourceData); this.flag = false; } }, |