I'm working on a webpage and looking at using Objects to store data in a frame, allowing users to reload the target area for navigation. If the user moves to another page, the object have the new data added while keeping the original data. The idea came from the "Planet" Object example in the "JavaScript Bible (7th Edition)" (A search for "javascript bible" returns a Google Books reference to 4th edition book on Wiley's site).
The best way to describe the Object I'm looking at would be an Excel spreadsheet. I have a "Worksheet" with multiple "Sheets" and, within that, "Cells". The "Cells" are broken out further into their respective properties and arranged in Columns and Rows. This is just an example, but is pretty close to the actual project. My plan is to populate the "Cells" with the values from a database onto a webpage. If the user switches to another "Sheet", new data is added to the Object and the old data is maintained. If the user switches back to the first "Sheet", the data will be accessed from the Object instead of reloading the page.
The webpage will have users increase the size, possibly exponentially, of the object over time. In the begining, data will be limited to a few cells.
I'm mostly looking for references to learn the process, diving into the details is how I learn. If you can provide one, that is great! If you have a code example, that would work as well.
So, here are my questions:
Is this the most efficient way of doing things? I am working with an Apache/MySQL/PHP setup. Should I be looking into other options? If there is a better way, it may need to wait for version 2.0, but I'm willing to look into it.
How do you "navigate" through an Object? For example, I want to switch to "Sheet2" and populate the "Cell" with an address of Column 24, Row 13. In the "Planet" Object tutorial ("JavaScript Bible"), they use an Array of Objects. Should the "Workbook" and "Sheets" all be Arrays with "Cell" Objects?
Is there a good resource, on the web or a book, that explains Objects and Prototypes in more detail than "JavaScript Bible (7th Edition)"?
Do you see a problem with the Object getting too big? There are 184,110 "Cells" in each "Workbook". Additionally, each "Cell" can have a minimum of 20-30 properties. So it is possible to have 5,523,300 "entries". I don't see it getting that huge as some cells will not have data (using smart coding, not populating data for entries with no records, etc), but 2 million "entries" would be possible over time.
Object size
The only problem I see here relates to performance: RAM and the processing time it takes to traverse the object tree. From what I gather, a mobile version is probably out of the question.
Some pseudo code to start you off with architecting your spreadsheet:
Code:
var spreadsheet = new Spreadsheet();
var workbook = spreadsheet.createWorkBook("workbook1");
var column = workbook.createColumn(0);
column.createCell("Contents go here", 0);
column.createCell("Something else", 1);
Bookmarks