Jump to content

Recommended Posts

Posted
Hi Kalvaitir. 

 

One of the possible solutions: 

 

UniDBGrid1 -> ClientEvents -> ExtEvents replace keydown function:

 




function keydown(e)

  if (e.keyCode == 9 && this.panel.uniCol == 1) {   
    this.panel.getSelectionModel().setCurrentPosition({row: this.panel.uniRow, column: 5});
  }
}



Does not work if the cell is in edit mode ... 

 

Try 

 

Best regards
  • Upvote 1
Posted

Does not work if the cell is in edit mode ... 

 

And add this code too. This allows you to move to another column in edit mode:

 

UniDBGrid1 -> ClientEvents -> ExtEvents add reconfigure function

function reconfigure(sender, store, columns, oldStore, the, eOpts)
{   
  columns[1].editor = {listeners: {
     specialkey: function(field, e) {
       if (e.getKey() == e.TAB) {                        
         sender.getSelectionModel().setCurrentPosition({row: sender.getSelectionModel().getCurrentPosition().row, column: 5});                             
       }
     }
    }
  };
}

Try...

 

Best regards.

Posted

thank you very much.

 

As I do in the event OnAfterLoad or OnEnter (uniDBGrid) go for a column?

 

I'm sorry I did not understand the question ...

 

ie, please clarify again ...

Posted

No problem! (Sorry, that I requested clarification many times!...)

function store.load(sender, records, successful, eOpts)
{
  sender.grid.getSelectionModel().setCurrentPosition({row: 1, column: 5});
}

post-906-0-55609500-1406220806_thumb.png

 

Best regards.

Posted

The reconfigure code did not work. The cursor moves to column 4, then to column 1, then column 4, then column 3.

 

How could I do to combine these two functions:

 

 

function reconfigure(sender, store, columns, oldStore, the, eOpts)

{

columns[1].editor = {listeners: {

specialkey: function(field, e) {

if (e.getKey() == e.TAB) {

sender.getSelectionModel().setCurrentPosition({row: sender.getSelectionModel().getCurrentPosition().row, column: 5});

}

}

}

};

}

 

function reconfigure(sender, store, columns, oldStore, the, eOpts)

{

columns[1].editor = {selectOnFocus: true};

 

// for all columns

for (var i = 0; i < columns.length; i++) {

columns.editor = {selectOnFocus: true};

}

}

 

Thank you!

Posted

Try

function reconfigure(sender, store, columns, oldStore, the, eOpts)
{  
  columns[1].editor = {selectOnFocus: true, listeners: {
     specialkey: function(field, e) {
       if (e.getKey() == e.TAB) {
         sender.getSelectionModel().setCurrentPosition({row: sender.getSelectionModel().getCurrentPosition().row, column: 5});
       }
     }
     }
  };
}
function reconfigure(sender, store, columns, oldStore, the, eOpts)
{  
  for (var i = 0; i < columns.length; i++) {
    columns[i].editor = {selectOnFocus: true};
  };  
  columns[1].editor = {selectOnFocus: true, listeners: {
     specialkey: function(field, e) {
       if (e.getKey() == e.TAB) {
         sender.getSelectionModel().setCurrentPosition({row: sender.getSelectionModel().getCurrentPosition().row, column: 5});
       }
      }
     }
  };
}
Posted
function reconfigure(sender, store, columns, oldStore, the, eOpts)
{ 
  columns[1].editor = {selectOnFocus: true, listeners: {
     specialkey: function(field, e) {
       if (e.getKey() == e.TAB) {
         sender.getSelectionModel().setCurrentPosition({row: sender.getSelectionModel().getCurrentPosition().row, column: 5});
       }
     }
     }
  };
}

OR (Do not need to put one under the other! (Sorry if I do not understand))

function reconfigure(sender, store, columns, oldStore, the, eOpts)
{ 
  for (var i = 0; i < columns.length; i++) {
    columns[i].editor = {selectOnFocus: true};
  };  
  columns[1].editor = {selectOnFocus: true, listeners: {
     specialkey: function(field, e) {
       if (e.getKey() == e.TAB) {
         sender.getSelectionModel().setCurrentPosition({row: sender.getSelectionModel().getCurrentPosition().row, column: 5});
       }
      }
     }
  };
}
Posted

use:

function reconfigure(sender, store, columns, oldStore, the, eOpts)
{ 
  for (var i = 0; i < columns.length; i++) {
    columns[i].editor = {selectOnFocus: true};
  };  
  columns[1].editor = {selectOnFocus: true, listeners: {
     specialkey: function(field, e) {
       if (e.getKey() == e.TAB) {
         sender.getSelectionModel().setCurrentPosition({row: sender.getSelectionModel().getCurrentPosition().row, column: 5});
       }
      }
     }
  };
}
  • 3 weeks later...
Posted

Added the following functions:

 

Keydown

 

function keydown(e)

{

if (e.keyCode == 9) {

this.panel.getSelectionModel().setCurrentPosition({row: this.panel.uniRow+1, column: 4})

}

}

 

 

Reconfigure

 

function reconfigure(sender, store, columns, oldStore, the, eOpts)

{

for (var i = 0; i < columns.length; i++) {

columns.editor = {selectOnFocus: true};

};

columns[1].editor = {selectOnFocus: true, listeners: {

specialkey: function(field, e) {

if (e.getKey() == e.TAB) {

sender.getSelectionModel().setCurrentPosition({row: sender.getSelectionModel().getCurrentPosition().row, column: 5});

}

}

}

};

}

 

 

It did not work. When the cell is being edited, it goes to the first column and not the fifth column.

  • Administrators
Posted

In the dbgrid as I do that, if the user presses Tab, go to a specific column?

 

I recommend not to try to implement such a complex functionality, instead re-design your business logic so this will not be needed.

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