CodeThatTable - Table Generation from the XML file

CodeThatTable - Table Generation from the XML file

//------------------------------------------------
//GLOBAL VARS
//------------------------------------------------
var DATE_FORMAT = "dd.mm.yyyy";
var CURRENCY_FORMAT = " $";
var EMPTY_ROW = "...";
var DEFAULT_COLDEF = {
	title : "",
	titleClass : "",
	type : "String", //the default type
	width : 0, //auto
	alignment : "", //auto
	compareFunction : compare,
	isVisible : true,
	useAutoIndex : false,
	useAutoFilter : false
};
//------------------------------------------------
//GRID DEFINITION
//------------------------------------------------
var gridDef = {
	useExportBar 	 : true,
	useMultiSort	 : true,
	useColTitle 	 : false,
	amountPerPage : 50,
	datatype : 2, data : "Scripts/csv.xml",
	//datatype : 3, data : "Scripts/xml.xml",
	colDef : [
	{
		title : "ID",
		titleClass : "", //default for th
		type : "Number",
		width : 0, //auto
		alignment : "center",
		compareFunction : compare,
		isVisible : true,
		useAutoIndex : false,
		useAutoFilter : false
	},
	{
		title : "Name",
		titleClass : "",
		type : "String",
		width : 0, //auto
		alignment : "",
		compareFunction : compare,
		isVisible : true,
		useAutoIndex : false,
		useAutoFilter : false
	},
	{
		title : "Reg. date",
		titleClass : "", //default for th
		type : "Date",
		width : 0, //auto
		alignment : "center",
		compareFunction : compare,
		isVisible : true,
		useAutoIndex : false,
		useAutoFilter : false
	},
	{
		title : "Account",
		titleClass : "", //default for th
		type : "Currency",
		width : 0, //auto
		alignment : "center",
		compareFunction : compare,
		isVisible : true,
		useAutoIndex : false,
		useAutoFilter : false
	} ],
	rowStyle : {
		markClass : "mark",
		darkClass : "dark",
		lightClass : "light",
		hoverClass : "hover"
	},
	keyCol : "ID",
	//rowHandler : rowHandler,
	tableStyle : {
		tableClass : {
			backgroundcolor : "#ececec"
		},
		thClass : "th",
		border : 1,
		cellpadding : 2,
		cellspacing : 0
	},
	resetSortControl : "reset sort",
	resetSearchControl : "reset search",
	resetMarkControl : "reset select",
	amountControl : "amount ->",
	searchControl : "search -> ",
	imgSortAsc : 	{
		src : "img/sortasc.gif", width : 10, height : 10
	},
	imgSortDesc : 	{
		src : "img/sortdesc.gif", width : 10, height : 10
	},
	imgSortAscActive : 	{
		src : "img/sortasca.gif", width : 10, height : 10
	},
	imgSortDescActive : 	{
		src : "img/sortdesca.gif", width : 10, height : 10
	},
	imgMultiSortAscActive : 	{
		src : "img/sortascma.gif", width : 10, height : 10
	},
	imgMultiSortDescActive : 	{
		src : "img/sortdescma.gif", width : 10, height : 10
	},
	imgFirstPage : {
		src : "img/firstpage.gif", width : 10, height : 10
	},
	imgLastPage : 	{
		src : "img/lastpage.gif", width : 10, height : 10
	},
	imgPrevPage : 	{
		src : "img/prevpage.gif", width : 10, height : 10
	},
	imgNextPage : 	{
		src : "img/nextpage.gif", width : 10, height : 10
	}
};