Hi,
My small page shows a grid whith commercial results of stores for the present day.
When I double click on a row I open a window with an attached grid which shows the last 30 days of the store selected.
This works fine (with your help).
Now, I would double click on a selected day in this second grid and open a new window with a grid showiing all the tickets of the customers (for that store and that day).
Here is my code. The second window is showed but empty and setText not working.
Is a mistake I’ve done or it’s not implemented ?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CA Magasins UniMag</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="codebase/dhtmlx.css">
<link rel="stylesheet" type="text/css" href="skins/web/dhtmlx.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<script src="codebase/dhtmlx.js"></script>
<script>
var myGrid;
var dhxWins, myWin;
function doOnLoad(){
myGrid = new dhtmlXGridObject('gridbox');
myGrid.setImagePath("codebase/imgs/");
myGrid.setHeader("Id,Code_SAP,Nom du Magasin,CA TTC,Vente HT, Achat HT,Marge HT, Taux de Marque (%), Taux de Marge (%),Frequentation,Panier,CA HT au m2,Surface,Id_Structure", "|",
["text-align:center,text-align:left;","text-align:center;","text-align:center;","text-align:center;","text-aligne:center;","text-align:center;","text-align:center;","text-align:center;","text-align:center;","text-align:center;","text-align:center;","text-align:center", "text-align:center"] );
myGrid.setInitWidths("30,65,255,112,112,112,112,103,103,98,88,110,100,60");
myGrid.setColAlign("center,center,left,center,center,center,center,center,center,center,center,center,center,center");
myGrid.setColTypes("cntr,ro,ro,ron,ron,ron,ron,ron,ron,ron,ron,ron,ron,ron");
myGrid.setColSorting("int,str,str,int,int,int,int,int,int,int,int,int,int,int");
myGrid.setNumberFormat("0,000.00 €",3);
myGrid.setNumberFormat("0,000.00 €",4);
myGrid.setNumberFormat("0,000.00 €",5);
myGrid.setNumberFormat("0,000.00 €",6);
myGrid.setNumberFormat("00.00 %",7);
myGrid.setNumberFormat("00.00 %",8);
myGrid.setNumberFormat("0000",9);
myGrid.setNumberFormat("0,000.00 €",10);
myGrid.setNumberFormat("0,000.00 €/m2",11);
myGrid.setNumberFormat("0,000 m2",12);
myGrid.setColumnHidden(13,true);
myGrid.enableAutoWidth(true);
myGrid.attachEvent("onRowDblClicked", doOnRowDblClicked);
myGrid.init();
myGrid.attachFooter("Synthèse,#cspan,#cspan,#stat_total,#stat_total,#stat_total,#stat_total,-,-,#stat_average,#stat_average,#stat_average,#stat_total",
["text-align:center;","text-align:center;","text-align:center;","text-align:center;","text-align:center;","text-align:center;","text-align:center;","text-align:center;","text-align:center;","text-align:center;","text-align:center;","text-align:center;","text-align:center;"]);
myGrid.load("extract.php","json");
}
function doOnRowDblClicked(rowId){
var id_Mag = myGrid.cells(rowId, 13).getValue();
dhxWins = new dhtmlXWindows();
dhxWins.attachViewportTo("winVP");
var detailWin = dhxWins.createWindow("detailWin", 40, 40, 850, 480);
detailWin.setText("30 derniers jours d'activité du magasin " + myGrid.cells(rowId, 2).getValue() + ", Id : " + id_Mag );
detailWin.setModal(true);
var detailGrid = detailWin.attachGrid();
detailGrid.setImagePath("codebase/imgs/");
detailGrid.setHeader("Date, CA TTC, Vente HT, Achat HT, Marge HT, Taux de Marque (%), Frequentation, Panier, CA HT au m2", "|" ,
["text-align:center;","text-align:center;","text-align:center;","text-aligne:center;","text-align:center;","text-align:center;","text-align:center;","text-align:center;","text-align:center;"] );
detailGrid.setInitWidths("90,90,90,90,80,85,85,85");
detailGrid.setColAlign("center,center,center,center,center,center,center,center,center");
detailGrid.setColTypes("ro,ron,ron,ron,ron,ron,ron,ron,ron");
detailGrid.setColSorting("str,int,int,int,int,int,int,int,int");
detailGrid.setNumberFormat("0,000.00 €",1);
detailGrid.setNumberFormat("0,000.00 €",2);
detailGrid.setNumberFormat("0,000.00 €",3);
detailGrid.setNumberFormat("0,000.00 €",4);
detailGrid.setNumberFormat("00.00 %",5);
detailGrid.setNumberFormat("0000",6);
detailGrid.setNumberFormat("0,000.00 €",7);
detailGrid.setNumberFormat("0,000.00 €/m2",8);
detailGrid.enableAutoWidth(true);
/*detailGrid.attachEvent("onRowDblClicked", onRowDetailDblClick);*/
detailGrid.attachEvent("onRowDblClicked", function(rowId){
dhxWins = new dhtmlXWindows();
dhxWins.attachViewportTo("winVP");
var detailWin = dhxWins.createWindow("ticketWin", 80, 80, 450, 400);
ticketWin.setText("Liste des tickets du jour" );
ticketWin.setModal(true);
var ticketGrid = ticketWin.attachGrid();
ticketGrid.setImagePath("codebase/imgs/");
ticketGrid.setHeader("n° Ticket,Montant TTC");
ticketGrid.init();
});
detailGrid.init();
var appel = "ca30.php?id_Mag='" + id_Mag + "'";
detailGrid.load(appel, "json");
}
function onRowDetailDblClick(rowId){
alert ("RowId is " + rowId);
dhxWins = new dhtmlXWindows();
dhxWins.attachViewportTo("WinVP");
var detailWin = dhxWins.createWindow("ticketWin", 80, 80, 450, 400);
ticketWin.setText("Liste des tickets du " + rowId);
/*ticketWin.setModal(true);*/
var ticketGrid = ticketWin.attachGrid();
ticketGrid.setImagePath("codebase/imgs/");
ticketGrid.setHeader("n° Ticket,Montant TTC");
ticketGrid.init();
}
function doOnUnload() {
}
</script>
</head>
<body onload="doOnLoad()">
<div id="winVP">
<div id="gridbox" style="width:1287px; height:778px;background-color:white;">
</div>
</body>
</html>
Thanks for your help
PS : If you think my way of coding is not the good one, I appreciate your recommandation.
PS : Sorry for my english!!!
Regards