JavaScript grid editor: I want to be Excel. Updated(roberto.open-lab.com)
roberto.open-lab.com
JavaScript grid editor: I want to be Excel. Updated
http://roberto.open-lab.com/2010/01/18/javascript-grid-editor-i-want-to-be-excel
3 comments
Formulas aside, you can roll your own Excel clone fairly easily. Have a normal HTML table, capture the cell clicks. On a click, replace the cell's HTML with that of a text box containing the same text. Capture tab, shift-tab and enter keypresses and you're nearly there.
you can roll your own Excel clone fairly easily
Well, it would need to be able to add rows/columns and delete them. Copy/pastability would help, too. A necessary pre-requisite for that is going to be the ability to select entire columns at a time -- that's going to have to be custom-done because your browser isn't that smart. Let's see, an undo wouldn't hurt. Oh, and the escape out of editing mode. And resizing when you overflow a single cell. Speaking of which, drag and drop resizing on arbitrary rows/columns.
There's probably a few requirements I'm missing, but no problem, I can whip up a Stack Overflow clone in like a weekend and solicit suggestions on what one or two trivial details I still need to implement to duplicate the thousands of man years in Excel.
Well, it would need to be able to add rows/columns and delete them. Copy/pastability would help, too. A necessary pre-requisite for that is going to be the ability to select entire columns at a time -- that's going to have to be custom-done because your browser isn't that smart. Let's see, an undo wouldn't hurt. Oh, and the escape out of editing mode. And resizing when you overflow a single cell. Speaking of which, drag and drop resizing on arbitrary rows/columns.
There's probably a few requirements I'm missing, but no problem, I can whip up a Stack Overflow clone in like a weekend and solicit suggestions on what one or two trivial details I still need to implement to duplicate the thousands of man years in Excel.
I'm not sure whether it wasn't obvious enough, or you're being a tad disingenuous. I was talking about a very simple implementation, which has worked for me on a number of occasions.
Incidentally, if you weren't just nitpicking and really do rely on copy/paste between Excel and a web-based spreadsheet you need to be careful. JavaScript only has access to the plain-text clipboard from Excel. This is just the stuff you can see. If anything has been truncated for display purposes in Excel, it'll be missing from the copy buffer.
Incidentally, if you weren't just nitpicking and really do rely on copy/paste between Excel and a web-based spreadsheet you need to be careful. JavaScript only has access to the plain-text clipboard from Excel. This is just the stuff you can see. If anything has been truncated for display purposes in Excel, it'll be missing from the copy buffer.
I think he meant copy and paste as in multiple cells in your sheet being copy/pastable.
This comment made me smile.
Already posted a few days ago:
http://news.ycombinator.com/item?id=1061726
Using Datatables for one of our projects, they are great and support many features!