Jump to content

StringGrid show editor when cell clicked/focussed after edit go to next cell row


yoser174

Recommended Posts

Dear uniGUI team,

if we activate goEditing on StringGrid, we need to click double click to show editor on the cell.

how to show cell editor when user focus or clicked on the cell without need double click or press F2?

 

I want to create application, user can edit value on column "Hasil"

image.png.95b3de2b22c5320c0a4b38de01499c1b.png

it need to double clicked on the cell, is it posible to auto show editor when cell focused or single clicked?

And after enter value focus change to next row and editor also shown:

image.png.c8b2cd9f12341f6bf79b0019557bcfee.png

looking fordward for your reply

 

Link to comment
Share on other sites

Dear Sherzod,

Thank you, it is working perfect.

please help me one more:

after press key <ENTER/RETURN> move to next row, and show editor:

image.png.c8b2cd9f12341f6bf79b0019557bcfee.png

like picture above, after input value 3.2 on the cell and after press <ENTER/RETURN> key, cursor move to next row.

how do I can perform that event?

thank you before.

Link to comment
Share on other sites

14 hours ago, yoser174 said:

like picture above, after input value 3.2 on the cell and after press <ENTER/RETURN> key, cursor move to next row.

Maybe something like this for start:

function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
{
    var grid = sender;
    var lockedGrid = grid.lockedGrid;
    var fixedColLength=0;
    
    for (var i = 0; i < columns.length; i++) {
        if (columns[i].getEditor()) {
            columns[i].getEditor().on('specialkey', function(field, e) {
                if (e.getKey() == 13) {
                    var store = grid.getStore();
                    var selModel = grid.getSelectionModel();
                    var selectedRecord = selModel.getLastSelected();
                    var recordIndex = store.indexOf(selectedRecord);
                    var nextRecord = store.getAt(recordIndex + 1);
                    if (nextRecord) {
                        grid.editingPlugin.completeEdit();
                        Ext.defer(function() {
                            selModel.select(nextRecord);
                            if (lockedGrid) {
                                fixedColLength = lockedGrid.columnManager.columns.length;
                            }
                            grid.editingPlugin.startEditByPosition({
                                row: grid.uniRow,
                                column: grid.uniCol + fixedColLength
                            }, true);
                        }, 50);
                    }
                }
            })
        }
    }
}

 

Link to comment
Share on other sites

  • 2 weeks later...

Dear Sherzod,

thank you for your help, amazing

Almost complete, the selected row change to next row. But bit wired the editor not changed (keep at current row).

2019-12-14_9-52-48.gif.209ece46a0e33b61829264daa6f9a516.gif

How do we can change the editor after row changed, I mean after enter, row change to next row, but when we press ENTER the editor also move to the selected row.?

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...