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

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.

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...