Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>My first response here is do not do it this way. Making a DB call every time someone enters a letter on a list will be very expensive for your DB access, and will drag your performance down something hideous. Even if you use an ajax call - there is no way you can get the responses back in a time that would work. So I would give you some broad suggestions:</p> <ol> <li><p>How many entries could there be? Could you load them into a JS array, and search them within JS? Probably not, otherwise you wouldn't need to do this process. </p></li> <li><p>Get the list from the DB once, and store it as a serialised object. Then search this object for the relevant options. Load this data in site initialisation.</p></li> <li><p>Once you have entered a character - or maybe 2, depending on your data - do an ajax call to get the entire relevant list of options. From there on, use this list in JS to restrict based on further input.</p></li> </ol> <p>Tweak this until it works well. I can give more details on any particular piece of this if required.</p> <p>EDIT based on more details.</p> <p>I would suggest that on the first key press, you load all the entries relevant for this single character. From there onwards, you search the loaded list for matches, narrowing it down from there.</p> <p>You should kick off an ajax query to get all of the references the first time, and do nothing else with the entries until this returns.</p> <p>You might also want to load the entire list into memory on the app load, and take a subset of this when needed. Possibly, take 26 entries one for each initial character, but that is probably OTT for this size. It might depend on the performance you get from the db calls and the selections.</p> <p>This is quite complex, but should produce you a respondent interface that does what you need.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload