Jump to content

Recommended Posts

Posted
use this function in UniDbGrid to jump to the next line pressing enter and put the field in edit mode not needing another enter.
in version 0.99 of unigui it works already in version 1.90 it is not working.

can someone help?

function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
 {
    var grid = sender;for (var i = 0; i < columns.length; i++) {
        columns.editor = {selectOnFocus: true};  //seleciona o texto
        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) {
                        selModel.select(nextRecord);
                        if (grid.editingPlugin && grid.uniRow && grid.uniCol){
                          var _row = grid.uniRow;
                          var _col = grid.uniCol;
                          setTimeout(function(){
                            grid.editingPlugin.startEdit(_row, _col);
                          }, 10);
                        }
                    }
                }
            })
        }
    }

  }

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...