:: Documentation >>

AW.CSV.Table

Table data model for comma-separated (or tab-separated) text files.

CSV table is based on AW.HTTP.Request class. It splits the returned text into rows and cells and implements getCount() and getData(col, row) methods to provide the data into the grid control.

Constructor

 var obj = new AW.CSV.Table; 

Hierarchy

Properties

asyncIndicates whether asynchronous download is permitted.
countRow count.
dataCell data.
namespaceAllows to specify namespaces for use in XPath expressions.
parameterAllows to specify the request arguments/parameters.
passwordSets or retrieves the password.
requestDataAllows to send data with the request.
requestHeaderSets HTTP request header.
requestMethodSpecifies HTTP request method.
responseHeaderReturns HTTP response header (for example "Content-Type").
responseTextReturns response text.
responseXMLReturns response XML.
URLSets or retrieves the remote data URL.
usernameSets or retrieves the user name.

Methods

cloneCreates an object clone.
definePropertyCreates get/set methods for the property.
getAsyncReturns async property
getCountReturns count property
getDataReturns data property
getPasswordReturns password property
getPropertyReturns property value.
getRequestDataReturns requestData property
getRequestMethodReturns requestMethod property
getResponseHeaderReturns responseHeader property
getResponseTextReturns responseText property
getResponseXMLReturns responseXML property
getURLReturns URL property
getUsernameReturns username property
initInitializes the object.
isReadyReturns true if the model data is available.
requestSends the request.
responseAllows to process the received data.
setAsyncSets async property
setNamespaceSets namespace property
setParameterSets parameter property
setPasswordSets password property
setPropertyAssigns property value.
setRequestDataSets requestData property
setRequestHeaderSets requestHeader property
setRequestMethodSets requestMethod property
setResponseTextSets responseText property
setResponseXMLSets responseXML property
setTimeoutCalls the function after the specified delay.
setURLSets URL property
setUsernameSets username property
toStringConverts object to string.

Examples

//  create external data model - CSV text table
var table = new AW.CSV.Table;

//  set data URL - plain text comma-separated file
table.setURL("../data/companies.csv");

//  start asynchronous data retrieval
table.request();

//  create ActiveWidgets Grid javascript object
var obj = new AW.UI.Grid;

//  assign external cell data model
obj.setCellModel(table);

//  set the number of columns, row count is taken from the table
obj.setColumnCount(5);

//  write grid html to the page
document.write(obj);

See also

XML data source

Comments

CSV Table - How to change cell data in a script ? Jose (2)

Documentation:

Recent changes:

2.6.4
2.6.3
2.6.2
2.6.1
2.6.1
2.6.0
2.5.0 - 2.5.6
2.5.6
2.5.0 - 2.5.5
2.5.5