:: Forum >>

Edit with key navigation like spreadsheet

does anyone can give me a hint, how to add script code like:
if(e.keyCode=="\t" && !e.shiftKey){
edit sameRowNextCell
}else if(e.keyCode=="\t" && !e.shiftKey){
edit sameRowPreviousCell
}else if(e.keyCode=="\n"){
edit nextRowSameCell
}
to the grid / input-field (/javascript.forum.1394.35/textbox-template-edit-on-double.html)

i want a edit behaviour like in spreadsheet.

Andres
Wednesday, March 9, 2005
i managed it to add the keyHandler to
My.Templates.Input.create = function()...
i tried it with moving a hilighted cell around in the grid with cursors

editor.setEvent("onkeydown", function (e){
        switch(e.keyCode){
            case 13:
            var pid = template.element();
            switchToTextMode(); // end actual edit
            [[b]how can set the focus to cell x/y and start: [/b]]
            switchToEditMode(); <-----
            break;
            ....
        }
    });


in short: how can i invoke a defined cell to switch to editmode without eventhandler.
It is not a technical problem, as i can do it by externalEditor(document.getElementById(this.nextSibling)).
But i would like to integrate it.

I Think this was the same question:.
(/javascript.forum.2405.0/how-edit-text-box-with.html)
Andres
Wednesday, March 9, 2005
i made a functional study for a spreadsheet like table editor.
you can see it working : http://webmail.mbn.ch/table/dyntable.php
and the additional javascript code: http://webmail.mbn.ch/table/edit.js (+eventlib.js)

Now, before doing a 'real' world design, i mean re-code the stuff, so myself and the rest of the world can understand what i made,

there remain a few questions about the'feeling' of the editor:

1. should the content be invisible selected when entering a cell as in excel?
2. How should the left/ right cursor behave - in excel there are to modes.
3. What about a insert new row at the bottom?
4. How should 'enter' behave? down one row, keeping the cell position, down one row and first cell or next cell? (database vs. spreadsheet)

The technical questions about the grid:
1. How can I deselect a selection without! refreshing the grid?
2. all the unanswered questions i made in my last few postings 'Autosize Column Widths' and 'i wrote a drag and drop row script'.
Andres Obrero [Winterthur]
Monday, March 14, 2005
Best Practices from large enterprise apps:

1. should the content be invisible selected when entering a cell as in excel?

- There should be a selection on the content as it is entered

2. How should the left/ right cursor behave - in excel there are to modes.

- in edit mode, left and right do not leave the cell they only move within the text of the cell

3. What about a insert new row at the bottom?

- inserting rows is usually below the currently selected record. New rows without a selection is on the top of the list

4. How should 'enter' behave? down one row, keeping the cell position, down one row and first cell or next cell? (database vs. spreadsheet)

- Enter should execute a "Save" command without leaving the record. (ever)

Down arrow / Up Arrow will also execute the "Save" command but will also move to the next / previous record

Tab will always move to the next column (in edit mode) Sometimes it also calls the "Save" command.

I hope that helps.
Frank (Canada)
Thursday, March 17, 2005
What code did you use for your "switchToEditMode()"?

I want to invoke the edit box on a cell when pressing Ctrl+E.
Wallace R
Thursday, November 30, 2006

This topic is archived.


Back to support forum

Forum search