Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
148631 | Oct 28,2019 05:36 PM UTC | Nov 4,2019 12:37 PM UTC | jQuery | 3 |
![]() |
Tags: ejGantt |
function update(){
$conn = new mysqli("localhost", "root","", "gantt", 3306);
//...
}
function add() {
$conn = new mysqli("localhost", "root", "", "gantt", 3306);
//...
}
function delete ()
{
$conn = new mysqli("localhost", "root", "", "gantt", 3306);
//...
} |
var gantt = new ej.gantt.Gantt({
dataSource: new ej.data.DataManager({
url: 'http://localhost:7777/GanttEJ2/getData.php/?action=getData',
crossDomain: true
}).executeQuery(new ej.data.Query()).then(function (e) {
gantt.dataSource = e.result;
}),
//...
actionComplete: function (args) {
if (args.action == "add" && args.newTaskData) {
var data = JSON.stringify(args.newTaskData);
$.ajax({
type: "POST",
url: 'http://localhost:7777/GanttEJ2/getData.php/?action=add',
data: data,
success: function (data) {
console.log(data);
}
});
}
if (args.action == "DialogEditing" || args.action == "CellEditing") {
var data = JSON.stringify(args.data.taskData);
$.ajax({
type: "POST",
url: 'http://localhost:7777/GanttEJ2/getData.php/?action=update',
data: data,
//...
});
}
if (args.action == "delete") {
var data = JSON.stringify(args.data[0].taskData);
$.ajax({
type: "POST",
url: 'http://localhost:7777/GanttEJ2/getData.php/?action=delete',
data: data,
//...
});
}
}
}); |
columns: [
{
field: 'TaskName',
headerText: 'Task Name',
// allowEditing: false
},
],
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.