MENIAL TOOLS DOT COM


- Assorted tools to help you through the day - 

A menial tool doing a menial task.

JSDC code generator - simple.




Regarding JSDC - JavaScript Data Components - at jsdc.sourceforge.net :
"The Javascript Data Components are libraries, made to give developers of dynamic web pages
an easy and fast way of making their applications more powerful using datasets, master-detail relations,
dataset-events, conditions and data-aware components.
"

This utility is designed to help users getting started by auto-generating code.
It generates the javascript code necessary to read data from a file and present it in a dao, a data aware object.
To use the code, just copy and paste it according to the instructions later on.
Just enter you settings and press the "generate code" - button.

Remember, though, that it does require that you have the JSDC files in a place where they can be reached by the code(through the path below).

Application settings



Here the general settings of the JSDC application object are set.

Title :
Errorcolor : 
IE OK color : 

Datatable settings



Here, you specify the settings for the how the
datatable accesses the data file(or data-generating script).
Currently, only .csv-style files are supported(no, it doesn't have to be named .csv).

The file/data path - is preferrably relative and the file should reside in the same domain as
the webpage, since most browsers do not allow cross-domain html requests by default.
Example: "/data/all_cars.csv".
File/data path :

Separators - For non-enterable characters, use normal javascript escape characters(like these. This page can also be helpful: www.asciitable.com.
Column separator :
Row separator : 

Headers - If the first row contains the column names, check this box.
If checked, the dataset will automatically name its columns based on the headers.
Has header row : 

Data aware object settings



The data aware object is the GUI of JSDC.
The "aware", means that it is notified by the dataview when changes occur in the underlying data, it is reflected in the dao.
Also, if a dao is edited, the data is updated.

Data aware object type - What type of dao do you want to use?
 
DAO type :



Code generation



This is where you make settings that control what the code you generate looks like.

Single file : Should all code reside in the HTML file(not recommended) or put in a separate .js-file (you must specify output file name below)?
Output file :  The generated separate JS file, if the above is set to a separate file.
Variable suffix :  What to base the variable names on.
JSDC path :  The relative path to the JSDC library files.

HTML



Javascript file




JSDC code generator - simple - version 1.0
This page is also a demonstrator for the open source JSDC library - Sourceforge: Javascript Data Components
© 2006 Nicklas B - webmaster : nicklasb@gmail.com Valid XHTML 1.0 StrictGet Firefox!