Shortcut key to open lookups in Selector fields - Forum - Rollbase - Progress Community

Shortcut key to open lookups in Selector fields

 Forum

Shortcut key to open lookups in Selector fields

This question is answered

Is there a way to open the lookup in selector field without using the mouse pointer?

i.e: when the focus is on the selector field, I should be able to press a key(or a combination of keys) on keyboard which will open the relevant lookup window.

Verified Answer
  • Unfortunately, the search icon button and create buttons do not have tab stops. You can put in an enhancement request to allow tabstops on supplementary buttons on fields.

    I suggest using the following javascript snippet to allow you to workaround this.

    $('.rbs-rel-selector.rbs-with-create input').on('keypress', function(e) {
      if (e.ctrlKey && e.charCode === 0) {
          var createButton = $(e.target).closest('.rbs-editField-valueContainer').find('button > span.k-icon.k-i-plus');
          if (createButton) {
              createButton.click();
          }
      }
    });

    With this script running on page load, you can press "Ctrl+Space" to open up the related 'Quick Create' popup if create button is present on the field.

All Replies
  • Unfortunately, the search icon button and create buttons do not have tab stops. You can put in an enhancement request to allow tabstops on supplementary buttons on fields.

    I suggest using the following javascript snippet to allow you to workaround this.

    $('.rbs-rel-selector.rbs-with-create input').on('keypress', function(e) {
      if (e.ctrlKey && e.charCode === 0) {
          var createButton = $(e.target).closest('.rbs-editField-valueContainer').find('button > span.k-icon.k-i-plus');
          if (createButton) {
              createButton.click();
          }
      }
    });

    With this script running on page load, you can press "Ctrl+Space" to open up the related 'Quick Create' popup if create button is present on the field.

  • Thanks Santosh,

    This works perfectly. Since I wanted to open the search lookup, I changed the code as follows and it works fine for the lookup button. And instead of page load, I put it on custom sidebar section so that it applies to all pages in the system.

    $('.rbs-rel-selector input').on('keypress', function(e) {
    
      if (e.ctrlKey && e.charCode === 0) {
    
          var createButton = $(e.target).closest('.rbs-editField-valueContainer').find('button > span.k-icon.k-i-search');
    
          if (createButton) {
    
             createButton.click();
    
          }
    
      }
    
    });