title: jQuery Mobile Filtered List - only match beginning of string
body: <p>Im using the jQuery mobile search filter list: 
  <a href="http://jquerymobile.com/test/docs/lists/lists-performance.html" rel="nofollow">http://jquerymobile.com/test/docs/lists/lists-performance.html</a></p>
  
  <p>Im having somer performance issues, my list is a little slow to filter on some phones. To try and aid performance I want to change the search so only items starting with the search text are returned. </p>
  
  <p>So 'aris' currently finds the result 'paris' but I want this changed. I can see its possible from the documentation below but I dont know how to implement the code. </p>
  
  <p><a href="http://jquerymobile.com/test/docs/lists/docs-lists.html" rel="nofollow">http://jquerymobile.com/test/docs/lists/docs-lists.html</a></p>
  
  <pre><code>$("document").ready( function (){
    $(".ui-listview").listview('option', 'filterCallback', yourFilterFunction)
  });
  </code></pre>
  
  <p>This seems to demonstrate how you write and call your own function, but ive no idea how to write it! Thanks 
  <a href="http://blog.safaribooksonline.com/2012/02/14/jquery-mobile-tip-write-your-own-list-view-filter-function/" rel="nofollow">http://blog.safaribooksonline.com/2012/02/14/jquery-mobile-tip-write-your-own-list-view-filter-function/</a></p>
  
  <p>UPDATE - Ive tried the following in a seperate js file: </p>
  
  <pre><code>$("document").ready( function (){
  
    function beginsWith( text, pattern) {
    text= text.toLowerCase();
    pattern = pattern.toLowerCase();
  
    return pattern == text.substr( 0, pattern.length );
    }
  
    $(".ui-listview").listview('option', 'filterCallback', beginsWith)
  
  });
  </code></pre>