« Return to the main article
Load the view into a javascript array...
[passthru HTML]<script> [passthru HTML]function CustomObject(a,b,c,d){ [passthru HTML]this.a=a; this.b=b; [passthru HTML]this.c=c; this.d=d; [passthru HTML]} [passthru HTML]thedata=new Array; [embed a view*] [passthru HTML]</script>
In the first column of the view
"thedata["+@DocNumber+"]=new CustomObject(escape(\'"+@ReplaceSubstring(@ReplaceSubstring(FIELDWITHDATA;"\'";" `");"\"";"`")+"\'),"
Subsequent columns
"escape(\'"+@ReplaceSubstring(@ReplaceSubstring(FIELDWITHMOREDATA;"\'";"`");"\"" ;"`")+"\'),"
last column
"escape(\'"+LASTFIELDDATA+"\') );"
Now all your data is stored in a javascript array.
Using innerHTML methods you can display them in any order you want within a table, or you can document.write a nice table with it.
The bonus is you can sort the array, so you can switch which column you sort by faster, since you don't have to go back to a server.
Load the view into a javascript array...
[passthru HTML]<script> [passthru HTML]function CustomObject(a,b,c,d){ [passthru HTML]this.a=a; this.b=b; [passthru HTML]this.c=c; this.d=d; [passthru HTML]} [passthru HTML]thedata=new Array; [embed a view*] [passthru HTML]</script>
In the first column of the view
"thedata["+@DocNumber+"]=new CustomObject(escape(\'"+@ReplaceSubstring(@ReplaceSubstring(FIELDWITHDATA;"\'";" `");"\"";"`")+"\'),"
Subsequent columns
"escape(\'"+@ReplaceSubstring(@ReplaceSubstring(FIELDWITHMOREDATA;"\'";"`");"\"" ;"`")+"\'),"
last column
"escape(\'"+LASTFIELDDATA+"\') );"
Now all your data is stored in a javascript array.
Using innerHTML methods you can display them in any order you want within a table, or you can document.write a nice table with it.
The bonus is you can sort the array, so you can switch which column you sort by faster, since you don't have to go back to a server.