Shortcut key to open lookups in Selector fields

Posted by Janani Nayanathara on 06-Apr-2018 03:44

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.

Posted by Santosh Patel on 06-Apr-2018 05:40

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

Posted by Santosh Patel on 06-Apr-2018 05:40

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.

Posted by Janani Nayanathara on 10-Apr-2018 00:20

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();

      }

  }

});

This thread is closed