ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: mscodigno on May 11, 2021, 03:14:14 pm

Title: Edit box arrow key navigation
Post by: mscodigno on May 11, 2021, 03:14:14 pm
Hello, I want to add navigation with arrow keys to the editor. I tried this topic but it didn't work.
https://paramquery.com/forum/index.php?topic=2630.msg10101#msg10101


http://jsfiddle.net/zekeriyaerogluu/kqmzv45u/41/
Title: Re: Edit box arrow key navigation
Post by: paramvir on May 11, 2021, 04:01:05 pm
That one is a different topic.

How exactly do you want to add navigation with arrow keys to the editor. Please describe your requirements.
Title: Re: Edit box arrow key navigation
Post by: mscodigno on May 11, 2021, 04:24:36 pm
I want to switch to text boxes in other cells with the arrow keys when the text box is open
Title: Re: Edit box arrow key navigation
Post by: paramvir on May 13, 2021, 11:07:37 am
Code: [Select]
editorKeyDown: function(evt, ui) {
  var obj = $.extend({}, ui), editCell;
  if(evt.keyCode == $.ui.keyCode.DOWN){
    obj.rowIndx++;
    obj.rowIndxPage++;
    editCell = true;
  }
  else if (evt.keyCode == $.ui.keyCode.RIGHT){
    obj.colIndx++;     
    editCell = true;
  }
  if(editCell){
    this.saveEditCell();
    this.editCell(obj)       
    return false;
  }
},

https://jsfiddle.net/ah74vkt2/2/

Above is a simple outline of the code and involved event.

Please update the logic to include checks for boundary conditions ( rowIndx should not be < 0 and should not exceed data length etc ) and if there are any hidden rows or columns.
Title: Re: Edit box arrow key navigation
Post by: mscodigno on May 20, 2021, 01:53:19 pm
Hello, thanks for the answer.

keyCode.RIGHT or LEFT: How can I skip the non-editable colons and switch to the other column?

keyCode.DOWN or UP: How can I skip summary and group headings and skip to other lines?
Title: Re: Edit box arrow key navigation
Post by: paramvir on May 25, 2021, 10:25:14 am
non editable columns can be identified by column.editable == false condition.

group headings have row meta data rowData.pq_gtitle = true

group summary rows have row meta data rowData.pq_gsummary = true

So keep on incrementing obj.colIndx++ until editable column is found and increment obj.rowIndx++ and obj.rowIndxPage++ until non grouping title / summary row is found.

Hope it helps.
Title: Re: Edit box arrow key navigation
Post by: mscodigno on May 31, 2021, 06:28:09 pm
I couldn't. Can you help me?

https://jsfiddle.net/zekeriyaerogluu/7qhacfxt/11/