|
Function Reference
|
Download and Try
There are three ways you can use the Objectsheet. Each has a specific purpose. They are:
Desktop or Web ApplicationThe Objectsheet is self contained in a single html file. You can download objectsheet.html and use it on your PC or Mac. Once downloaded, you can load and save files to your local hard drive.
Note: You can also specify a file for the Objectsheet to automatically load. e.g.: http://richk.net/os/objectsheet.html?file=sheets/todo.os Note: The file above is stripped of comments to save space. See "Desktop Application with Commented Source Code" version below for full source code. Desktop Application with Commented Source Code and ExamplesThe Objectsheet source is hosted on SourceForge at sourceforge.net/projects/objectsheet. You can download the entire commented source, along with examples and other support utilities. Once downloaded, extract the files anywhere on your local harddrive. Double-click on the file called "os.html". There are example Objectsheets stored in ./sheets. This is also the default directory for opening and saving files. The utility './test_support/AggregateFiles.html' converts the source files into objectsheet.html. Embedded Within a WebpageFrom your own webpage, you can point to the Objectsheet engine and stylesheet at richk.net (os.js and os.css*) or you can upload these files to your own web server. You can then embed Objectsheet Sections in a webpage. These sections can interact with each other and with other HTML elements on the webpage. This the approach used in the Objectsheet tutorial pages. A good starting point is to download one of the Objectsheet HTML files (objectsheet.html or osc.html) and modify it with your own HTML. * Note: os.js and os.css are aggregated and comment-stripped versions of the original source code. Instructions: Within any webpage, you can create a basic Objectsheet table using the following HTML: <head> <link rel="stylesheet" type="text/css" href="http://richk.net/os/os.css" /> <script language="javascript" src="http://richk.net/os/os.js"></script> </head><body> <script> table1 = new TableSection("table1", "", 3,3).draw().calc(); </script> </body> Note: The link tag goes in the <head> section of the webpage, while the script tag that creates the TableSection goes in the <body> part. The tag that loads os.js can go either in the <head> or the <body> of the webpage. The syntax of the TableSection constructor is:
For instance, if you want to create a table with four columns with the numbers 2, 4, 6, and 8 in the first row and 3, 5, 7, 9 in the second row, you can use either of the following:
In each case, the Table will grow to fill the array you specify; in this case, it will grow to 4 columns.
After creating the new Section with All of the tutorial examples use the above technique for creating and displaying Objectsheet Sections within a webpage. To see more examples of the above, go to one of the tutorial pages and from your Browser menu, select View > Source or View > Page Source. |
| © Rich Knopman, 2008 (rich -at- cometresearch -dot- com) | |