jahlxx Posted April 7, 2016 Posted April 7, 2016 hi. in a tunidbgrid, de arrows keys of the keyboard, doesn't move row up or row down, or column left, column right. The effect that those keys produce, is scroll of the grid view, not row or column change. any property I have forgotten to set? thanks. Quote
jahlxx Posted April 8, 2016 Author Posted April 8, 2016 ok. thanks. ir works, more or less. now with the arrow keys, I can move row up an down, and column left and right, but when I press the right arrow in the last column, the cursor goes to the first column of the next row. If is the last column, the cursor must stay in the las colummn of the same row. Quote
Sherzod Posted April 8, 2016 Posted April 8, 2016 now with the arrow keys, I can move row up an down, and column left and right, but when I press the right arrow in the last column, the cursor goes to the first column of the next row. If is the last column, the cursor must stay in the las colummn of the same row. Hi, For now try... in MainForm.Sript add this: Ext.override(Ext.view.Table, { walkCells: function (pos, direction, e, preventWrap, verifierFn, scope) { var grid = pos.view.headerCt.grid; if ((direction == 'right' && grid.columnManager.columns[grid.uniCol+1] && grid.columnManager.columns[grid.uniCol+1].isVisible()) || (direction == 'left' && grid.columnManager.columns[grid.uniCol-1] && grid.columnManager.columns[grid.uniCol-1].isVisible()) || (direction == 'down' || direction == 'up')) { return this.callParent(arguments); } else { return false; } } }); Best regards. Quote
Stemon63 Posted April 14, 2016 Posted April 14, 2016 I want exactly the opposite :-)I want that the cursor goes to the first column in the next row (default way)... Quote
jahlxx Posted May 24, 2016 Author Posted May 24, 2016 In this way, as Delphi Developer says, two more details: - now, pressing de End key, the grid goes to the last row. I'd like to do to the last column - now pressong the Home key, the grid goes to the first row. I'd like to go to the first column How can I do this? Thanks. Quote
Sherzod Posted May 24, 2016 Posted May 24, 2016 two more details: - now, pressing de End key, the grid goes to the last row. I'd like to do to the last column - now pressong the Home key, the grid goes to the first row. I'd like to go to the first column How can I do this? Hi, Try, may help: UniDBGrid -> ... function keydown(sender, key, shift, eOpts) { if (sender.button == 34 || sender.button == 35) sender.preventDefault(); } function afterrender(sender, eOpts) { sender.getEl().addKeyMap({ eventName: "keyup", binding: [{ key: Ext.EventObject.HOME, fn: function() { sender.getSelectionModel().setCurrentPosition({row: sender.uniRow, column: parseInt(sender.query('gridcolumn:not([hidden])')[0].dataIndex)}) } }, { key: Ext.EventObject.END, fn: function() { sender.getSelectionModel().setCurrentPosition({row: sender.uniRow, column: parseInt(sender.query('gridcolumn:not([hidden]):last')[0].dataIndex)}) } }] }); } Best regards. Quote
jahlxx Posted May 25, 2016 Author Posted May 25, 2016 ok. but this must only be in home / end keypress, not with shft, ctrl, or Alt. Thanks. Quote
Sherzod Posted May 25, 2016 Posted May 25, 2016 ok. but this must only be in home / end keypress, not with shft, ctrl, or Alt. Thanks. function afterrender(sender, eOpts) { sender.getEl().addKeyMap({ eventName: "keyup", binding: [{ key: Ext.EventObject.HOME, shift: false, alt: false, ctrl: false, fn: function() { sender.getSelectionModel().setCurrentPosition({row: sender.uniRow, column: parseInt(sender.query('gridcolumn:not([hidden])')[0].dataIndex)}) } }, { key: Ext.EventObject.END, shift: false, alt: false, ctrl: false, fn: function() { sender.getSelectionModel().setCurrentPosition({row: sender.uniRow, column: parseInt(sender.query('gridcolumn:not([hidden]):last')[0].dataIndex)}) } }] }); } Quote
jahlxx Posted January 13, 2017 Author Posted January 13, 2017 Hi, For now try... in MainForm.Sript add this: Ext.override(Ext.view.Table, { walkCells: function (pos, direction, e, preventWrap, verifierFn, scope) { var grid = pos.view.headerCt.grid; if ((direction == 'right' && grid.columnManager.columns[grid.uniCol+1] && grid.columnManager.columns[grid.uniCol+1].isVisible()) || (direction == 'left' && grid.columnManager.columns[grid.uniCol-1] && grid.columnManager.columns[grid.uniCol-1].isVisible()) || (direction == 'down' || direction == 'up')) { return this.callParent(arguments); } else { return false; } } }); Best regards. Hi. This solution works ok, and have been working ok for me, but not when have locked columns. Any idea? Thanks. Quote
Sherzod Posted January 14, 2017 Posted January 14, 2017 This solution works ok, and have been working ok for me, but not when have locked columns. Any idea? Hi, Try this: Ext.override(Ext.view.Table, { walkCells: function (pos, direction, e, preventWrap, verifierFn, scope) { var grid = pos.view.headerCt.grid; if ((direction == 'right' && grid.columnManager.columns[pos.column+1] && grid.columnManager.columns[pos.column+1].isVisible()) || (direction == 'left' && grid.columnManager.columns[pos.column-1] && grid.columnManager.columns[pos.column-1].isVisible()) || (direction == 'down' || direction == 'up')) { return this.callParent(arguments); } else { return false; } } }); Best regards. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.