I wanted to do something similar... so I think its a great idea. Unfortunately I do not have so much time at the moment. I think it would also be great to open or import and export simple excel files.
I wish you good luck for this project.
Now about formulas you may need a formula parser check out this links
though they are quite good for calculating excel cells type you may need to make some changes that code n order to make it work as you want
Very cool so far! For formulas, it seems like there are two choices:
1) Send data back to the server so its stored there in a mirrored spreadsheet. Use the openoffice API to do the calculations and send back the results. Another good choice might be spreadscript:
This is a nice solution because it could apply more than just formulas - like integration with external data sources. With your spreadsheet being web-based, that might give it a killer purpose to be database-connected instead of just an simple excel clone. Anyways, you probably want to store the data so you'll have to send it over the wire at some point.
Possible to capture enter, shift-enter, tab, shift-tab, up, down, left, right keys to allow navigation? Also integration of drag-drop from Excel?
I'm going to begin implementing above features for a current project.
Yes, doing formulas (especially the simpler ones) client-side is important even if you send to the server, because nobody would want to wait for an ajax response to say sum(A1:A5) when its such an easy calculation, so it seems like the right approach to start there.
For some reason, I wasn't able to create a formula. I guess I'm doing something wrong with the syntax, or maybe I'm just assuming it would work like excel and something is off (as of course its still very new untested software so thats reasonable).
Anyways, recursive formulas are a trick. If you haven't figured it out, I would suggest making a stack of the recursive calls (such as A1=sum(B1) and B1=sum(A1)) then going over it until you see the same cell used within the nested expression.
hi luke lukefowell89,
sure i can provide you some feedback.
first of all, you should really use a MultiCellSelectionModel like:
With it, you can walk through the cells with the arrow-keys, select blocks of cells (like in your version), but also multiple blocks using CTRL.
For the formulas you need to create listeners, e.g. at the cells.
like if you use c3 = a1 + a2, each change of a1 or a2 need to change c3 as well. don't forget to remove listeners if you change / remove formulas.
best regards and have fun with your project
the listeners for formulas (if there are already implemented) don't work properly.
if i enter a formula like =A1 + A2 it shows the right value.
if i change A2 afterwards, it does not update.
see my topic above for details.
i still recommend the multiCellSelectionModel i linked to