:: Forum >>

How to edit a CSV file in a browser Grid?

I am trying to read CSV file, into an editable grid make cell changes then save the edited cells back to the CSV file. Reading the CSV file in and making the table editable is pretty strait forward but writing the data back to the CSV file, well there is the trick. Can some help? I am favoring a server-side PHP scrip but I am open to all and any suggestionsÂ… Here is the first easy part of the code:

<link href="../../runtime/styles/xp/aw.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/aw.js"></script>

<style>
.aw-mouseover-cell {background: #def;}
#myGrid { width: 320px;}

</style>
</head>
<body>

<script>
var myHeaders = ["Ticker", "Company Name", "Market Cap."];
var table = new AW.CSV.Table;
table.setURL("/test.csv");
table.request();

var obj = new AW.UI.Grid;
obj.setId("myGrid");
obj.setColumnCount(3);
obj.setCellModel(table);
obj.setHeaderText(myHeaders);
obj.setCellEditable(true);

document.write(obj);

</script>
</body>
</html>

The test.csv look like this:
"MSFT","Microsoft Corporation","314,571.156"
"ORCL","Oracle Corporation","62,615.266"
Stephen Mal
Monday, November 20, 2006
You will have to send the grid data to the server, and the server has to save it. You cannot save local files with Javascript (a security issue).
Karl Thoroddsen
Tuesday, November 21, 2006

This topic is archived.


Back to support forum

Forum search