Hi, i´m trying to create a treetable with custom script in php. i already done the data loading part (READ), now i am struggling with insert, update and delete part. I´ve tried initiate the webix with save but appears to be not working…
The webix code part is:
view:"active_treetable",
id:"grid",
columns:[
{ id:"a", header:["A", {content:"textFilter"}], width:477, editor:"text", sort:"string", template:"{common.treetable()}#a#"},
{ id:"b", header:["B", {content:"selectFilter"}], width:200, sort:"date", template:"#b#"},
{ id:"c", header:["C", {content:"selectFilter"}], width:200, sort:"date", template:"#c#"},
{ id:"d", header:["D", {content:"selectFilter"}], width:70, sort:"int", template:"#d#"},
{ id:"e", header:["E", {content:"selectFilter"}], width:80, editor:"text", sort:"int", template:"#e#"}
],
ready:function(){
ready_handler(this);
},
onClick:onclick_handler,
scrollX:false,
select:"row",
navigation:true,
editable:true,
editaction:"dblclick",
yCount:7,
autowidth:true,
save: {
updateFromResponse:true,
url:"data.php"
},
url:"data.php"
};
The php part is:
//CONNECTS WITH DB HERE
//POST operation to be made
$webix_operation = $_POST['webix_operation'];
echo $webix_operation;
switch ($webix_operation) {
case "insert":
$output = "<script>console.log(123);</script>";
echo $output;
break;
case "update":
$output = "<script>console.log(456);</script>";
echo $output;
break;
case "delete":
$output = "<script>console.log(789);</script>";
echo $output;
break;
default:
//READ (HERE IS OK!)
dataLoading($conn);
break;
}