Hello…
I have a grid like this:
function InitPageGrid(nodeId){
gridP = new dhtmlXGridObject(‘for_grid’);
gridP.setImagePath(“css/images/”);
gridP.setSkin(“light”);
gridP.setNoHeader(true);
gridP.init();
gridP.loadXML(“db/dataprocessor/get.php?object=page&id=”+nodeId);
gridP._key_events.k46_0_0=function() {
if(!this.editor && this.row) this.deleteRow(this.row.idd);
else return false;
}
dhxDataProcessor = new dataProcessor(“db/dataprocessor/update.php?object=page”);
dhxDataProcessor.setTransactionMode(“POST”);
dhxDataProcessor.enableDataNames(true);
dhxDataProcessor.enableDebug(true);
dhxDataProcessor.init(gridP);
}
The code to generate xml:
echo “”;
echo " “.FIO_STUDENT.”";
$sql=“select * from lessons where si_id=”.$id;
$arrays_in=cdb_query_array($sql);
for ($j=0; $j<count($arrays_in); $j++){
echo " “.LESSON.”#".($j+1)."";
}
echo “”;
echo “”;
echo “”;
for ($j=0; $j<count($arrays_in); $j++){
echo “<cell id=’”.$arrays_in[$j][‘l_id’]."’>";
}
echo “”;
echo “”;
echo “”;
for ($j=0; $j<count($arrays_in); $j++){
echo “<cell id=’”.$arrays_in[$j][‘l_id’]."’>";
}
echo “”;
$sql=“select * from student where gro_group_id in (select group_id from journal_page where si_id=”.$id.")";
$arrays=cdb_query_array($sql);
for ($i=0; $i<count($arrays); $i++){
echo “<row id=’”.$arrays[$i][‘s_id’]."’>";
echo “”;
for ($j=0; $j<count($arrays_in); $j++){
echo “<cell id=’”.$arrays_in[$j][‘l_id’]."’>";
}
echo “”;
}
So to update the cell I need to know rowId and cellId… Is it possible using Dataprocessor to get in php script not only gridId (rowId) but also cellID of the updated cell??? Thank you…
You can use dp.enableDataNames(true) mode. In such case dataProcessor will send colum id’s instead of c0-cN.
on the server side:
$_GET[‘c0’] ⇒ $_GET[‘name’]
$_GET[‘c1’] ⇒ $_GET[‘second column id’]
Thank you very very much…
I use foreach to get the key value in server side code like this:
foreach($_POST as $key => $value){
if (is_numeric($key)){
…
}
}
Thank’s a lot