:: Forum >>

Refresh a AW.SCV.Grid before modifing it's csv

I'm using a Mysql query whitch create a csv file ( SELECT * INTO OUTFILE 'C:/Fichiers/banques.csv' ), then this csv file is puted in the AW.UI.Grid by using this code :

<script>
// create ActiveWidgets data model - CSV text table
var table = new AW.CSV.Table;
// provide data URL - plain text comma-separated file
table.setURL("banques.csv");
// start asynchronous data retrieval
table.request();
// create ActiveWidgets Grid javascript object
var obj = new AW.UI.Grid;
// assign unique id for the grid element
obj.setId("myGrid");
// define column labels
var columns = ["ID_banque","nom","adresse","tel","e_mail"];
// set column labels
obj.setHeaderText(columns);
// number of columns
obj.setColumnCount(5);
// define data formats
var str = new AW.Formats.String;
var num = new AW.Formats.Number;
// set data formats
obj.setCellFormat([str, str, str, str, str]);
// enable row selectors
obj.setSelectorVisible(true);
obj.setSelectorText(function(i){return this.getRowPosition(i)+1});
obj.setSelectorWidth(25);
// set row selection
obj.setSelectionMode("single-row");
// assign external 'data model'
obj.setCellModel(table);
obj.refresh();
// write grid html to the page
document.write(obj);

function load(url){
table.setURL(url);
table.request();
}

</script>

this code works very well. But the PROMBLEM is when i add a new record my database the csv will be modified and not the Grid contents even when click on : <button onclick="load('banques.csv')">Dataset1</button>


Please samone help me !!
Tks.


Maher
Thursday, April 3, 2008
http://www.activewidgets.com/javascript.forum.7913.8/refresh-grid.html
Thursday, April 3, 2008

This topic is archived.


Back to support forum

Forum search