- Fri Jul 31, 2015 8:07 am
#783805
Hello,
i try to generate a *.csv-File from a Grid. But it doesn't work.
pro_grid is my Grid-Variable
I used the following code...
thanks
mpm
i try to generate a *.csv-File from a Grid. But it doesn't work.
pro_grid is my Grid-Variable
I used the following code...
Code: Select all
any clue what's wrong - I guess the grind handling, but I'm not sure...$outputdata = "AnlagenNr; Proviart; KdNr; Name;Agent; Umsatz; Volumen";
$file = "testfile.csv";
$gridrows = $("#pro_grid").find(".pmdynaform-grid-row");
alert("Starte Datei " + $file); // only for test
file_put_contents($file, $outputdata);
for (i=1; i <= gridrows.length; i++)
{
$outputdata = "";
$outputdata = document.getElementById("form[pro_grid]["+i+"][Uniid]").value + ";";
$outputdata = $outputdata + document.getElementById("form[pro_grid]["+i+"][proviart]").value + ";";
$outputdata = $outputdata + document.getElementById("form[pro_grid]["+i+"][sis_kdnr]").value + ";";
$outputdata = $outputdata + document.getElementById("form[pro_grid]["+i+"][SISKdName]").value + ";";
$outputdata = $outputdata + document.getElementById("form[pro_grid]["+i+"][Agent]").value + ";";
$outputdata = $outputdata + document.getElementById("form[pro_grid]["+i+"][umsatz]").value + ";";
$outputdata = $outputdata + document.getElementById("form[pro_grid]["+i+"][Proivalue]").value + ";";
file_put_contents($file, $outputdata, FILE_APPEND);
}
alert("Datei " + $file + " wurde mit " + gridrows.length + " Zeilen erstellt"); // only for test
thanks
mpm