Hi,
I’ve look into the board but there is no the solution
I have a problem with the inserting of a new row in the grid, in particular in my index.php I’ve two function:
function addRow(){
var newId = (new Date()).valueOf();
var myId = mygrid.getRowsNum()+1;
mygrid.addRow(newId,"",myId);
}
and
function removeRow(){
var selId = mygrid.getSelectedId();
mygrid.deleteRow(selId);
}
If I change the values of existing rows the update button works well.
The removeRow() works well.
The addRow() don’t works:
the dataprocessor log shows:
“row 1372858568742 marked [inserted,valid]” when I call addRow()
“row 1372858568742 marked [updated,valid]
row 1372858568742 marked [updated,valid]
row 1372858568742 marked [updated,valid]
row 1372858568742 marked [updated,valid]
row 1372858568742 marked [updated,valid]” when I write into the cell
but when I update the change of the new row:
"Initiating data sending for all rows
Sending all data at once
Server url: connectorSqlite3.php?editing=true parameters
null
Server response received details
<?xml version='1.0' ?>Action: error SID:1372858568742 TID:1372858568742
row 1372858568742 unmarked [updated,error]"
my index.php
<body>
<div id="gridbox" style="width:800px;height:300px;background-color:white;"></div>
<script type="text/javascript">
var mygrid = new dhtmlXGridObject("gridbox");
// Massima altezza prima dello scroll
mygrid.enableAutoHeight(true,300,true);
//mygrid.enableSmartRendering(true,50);
mygrid.setImagePath("codebase/imgs/");
mygrid.setHeader("id, parentID, entryName, value, minValue");
mygrid.setColumnIds("id, parentID , entryName , value, minValue");
mygrid.attachHeader("#text_filter,#text_filter,#text_filter,#text_filter,#text_filter");
mygrid.setColAlign("center,center,center,center,center,");
mygrid.setColTypes("ed,ed,ed,co,ed");
mygrid.setColSorting("int,int,char,char,int");
mygrid.setSkin("dhx_skyblue");
combo = mygrid.getCombo(3);
combo.clear();
combo.put('a','a');
combo.put('b','b');
combo.put('c','c');
combo.save();
function addRow(){
var newId = (new Date()).valueOf();
var myId = mygrid.getRowsNum()+1;
mygrid.addRow(newId,"",myId);
}
function removeRow(){
var selId = mygrid.getSelectedId();
mygrid.deleteRow(selId);
}
mygrid.init();
//mygrid.loadXML('connectorMySql.php');
mygrid.loadXML('connectorSqlite3.php');
//var dp = new dataProcessor('connectorMySql.php');
dp = new dataProcessor('connectorSqlite3.php');
//Autoupdate commentare le due linee di codice qui sotto
dp.setTransactionMode("POST", true);
dp.setUpdateMode("off");
dp.init(mygrid);
</script>
<input type="button" name="some_name" value="update" onclick="dp.sendData();">
<input type="button" onclick='addRow();' value='Inserisci riga'>
<input type="button" onclick='removeRow();' value='Elimina riga'>
</body>
what’s wrong?
Best regards