Jump to content

Recommended Posts

Posted

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.

Posted

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.

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

  • 1 month later...
Posted

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.

Posted

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.

Posted

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)})
            }
        }]
    });
}
  • 7 months later...
Posted

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.

Posted

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.

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