Ok, thanks very much.
Now the display works just fine.
But to update the grid does not work.
I get an XML error (Incorrect XML) as soon as I try to change a field (or
delete a row).
Checked the XML, and for me it’s ok.
To load the grid :
I have this
$grid = new GridConnector($link);
$config = new GridConfiguration();
$config->setHeader("gite,Nom,Début,Fin,Arrivé,Départ,$mon1,$mon2,Couleur,Actif");
//$config->setColIds("c1,c2,c3,c4,c5,c6,c7,c8,c9");
$config->setInitWidths("1,160,70,70,70,70,90,90,60,60");
$config->setColAlign("Left,left,left,left,left,left,right,right,center,center");
$config->setColTypes("ro,ed,ed,ed,ed,ed,ed,ed,cp,ch");
// $config->setColHidden(array("id_gite" => "true"));
$grid->set_config($config);
$grid->event->attach("beforeRender","formatting");
$grid->event->attach("beforeUpdate","my_update");
$grid->enable_log("error.log", true);
$grid->enable_live_update('period');
$sqlStr = "SELECT id,id_gite, name,start,end,Arrtime,Deptime,price,price_2,color,active from period WHERE id_gite = $id";
//$grid->render_table('period', "id","id_gite,name,start,end,Arrtime,Deptime,price,price_2,color,active");
//$grid->render_sql($sqlStr, "id", "id_gite, name,start,end,Arrtime,Deptime,price,price_2,color,active");
if ($grid->is_select_mode())//code for loading data
$grid->render_sql($sqlStr, "id", "id_gite,name,start,end,Arrtime,Deptime,price,price_2,color,active");
else //code for other operations - i.e. update/insert/delete
$grid->render_table('period', "id","id_gite, name,start,end,Arrtime,Deptime,price,price_2,color,active");
As you can see, I tried first just an render_sql, then the if statement on the end (commented out the simple render_sql). It makes no difference.
Steven