Jump to content

Kalvaitir

Recommended Posts

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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});
       }
      }
     }
  };
}
Link to comment
Share on other sites

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});
       }
      }
     }
  };
}
Link to comment
Share on other sites

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});
       }
      }
     }
  };
}
Link to comment
Share on other sites

  • 3 weeks later...

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.

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