Note that there are some explanatory texts on larger screens.

plurals
  1. POAvoid autosearch
    primarykey
    data
    text
    <p>I recently implemented Christophe Coenraets' Employee Directory App to our company, simplifying it a bit, since we don't need manager functionality.</p> <p>One thing that is keeping me from release, is the autosearch feature, that I simply can't find a way of deactivating it, and instead set up a standard search box and submit button behavior. Our 1500+ employee database is too much for even the iPhone 5, and is very slow and sluggish.</p> <p>I tried posting on his blog, but it gives me a database error.</p> <p>Here is the link to his App: <a href="http://coenraets.org/blog/2012/03/employee-directory-sample-app-with-backbone-js-and-jquery-mobile/" rel="nofollow">http://coenraets.org/blog/2012/03/employee-directory-sample-app-with-backbone-js-and-jquery-mobile/</a></p> <p>Anyone familiar with this App or backbone.js that might throw some light on this?</p> <p>Many thanks.</p> <p><strong>UPDATE</strong>: I found an easier way of implementing the search by delaying it 1.5 seconds. I added the _.debounce function of the underscore.js framework here:</p> <pre><code>search: _.debounce(function(event){ var key = $('.search-key').val(); this.model.findByName(key); }, 1500) }); </code></pre> <p>Thanks again for your responses.</p> <p><strong>UPDATE 2</strong>: I went and tried to make the App work with the enter key, instead of the wait period. This is my code so far, but it just stays there, and doesn't respond to the Enter key. The console says nothing either. Any ideas?</p> <pre><code>events: { //"keyup .search-query": "search", "keypress .search-query": "onkeypress" }, search: function () { var key = $('.search-key').val(); console.log('search ' + key); this.searchResults.findByName(key); setTimeout(function () { $('.dropdown').addClass('open'); }); }, onkeypress: function (event) { if (event.keyCode == 13) { event.preventDefault(); this.search() } } }); </code></pre>
    singulars
    1. This table or related slice is empty.
    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. 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