autocomplete aka Is it possible to auto search the database as the user is typing in a virtual field?

10 views
Skip to first unread message

AppSynergy Support

unread,
Feb 4, 2021, 1:50:31 PM2/4/21
to AppSynergy by ParaSQL Support
Is it possible to auto search the database as the user is typing in a virtual field?

AppSynergy Support

unread,
Feb 4, 2021, 1:56:04 PM2/4/21
to AppSynergy by ParaSQL Support
Yes!

You can simply put an INPUT event on the quick search box (i.e. the virtual field used for the user to type into) with code like this:

function (event) {

  let input
= event.domEvent.target;
  let searchButton
= parasql.app.getWidgetById('ID22922');

  if (input.timer) clearTimeout(input.timer); // clear any previous timer
  input
.timer = setTimeout(function() {

    searchButton
.performClick(); // click the search button - changes focus
    input
.focus(); // refocus field
    input
.selectionStart = input.selectionEnd = input.value.length; // put cursor at end

 
}, 500);

}


Reply all
Reply to author
Forward
0 new messages