I want to implement curd manager to update, retrieve , delete and insert into db
I tried but not getting through docs.
here is the code
const crudManager = new CrudManager({
transport: {
sync: {
url: 'php/save.php'
}
}
});
crudManager.sync().
// no load errors occurred
then((response) => {
console.log('Curd' + response);
}).
// loading failed
catch(response => {
// show notification with error message
Toast.show(response && response.message || 'Unknown error occurred');
});
const project = new ProjectModel({
tasksData: info.data.tasks.rows,
resourcesData: info.data.resources.rows,
assignmentsData: info.data.assignments.rows,
dependenciesData: info.data.dependencies.rows,
//eventModelClass: Task,
});
// let [button1, button2] = WidgetHelper.append([
// {
// type: 'button', icon: 'user',
// text: 'Data Summarize'
// },
// {
// type: 'button', icon: 'user',
// text: 'Schedule Check'
// },
// ], { appendTo: this.elementRef.nativeElement.firstElementChild });
const gantt = new Gantt({
project: project,
...ganttConfig,
crudManager,
responsiveLevels: {
small: {
levelWidth: 600,
rowHeight: 30,
barMargin: 0
},
normal: {
levelWidth: '*',
rowHeight: 50,
barMargin: 10
}
}
}),
tbar = ganttToolbar(gantt)
let config = {
appendTo: this.elementRef.nativeElement.firstElementChild,
widgets: [gantt],
tbar,
listeners: {
hasListener(eventName) {
console.log(eventName);
},
catchAll(event) {
console.log('TEST00');
console.log(event);
console.log('Test001')
}
}
};
// panel renders to this component's element
new Panel(config);
}