Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I need to implement Custom Search in Framework7

I have a 2 set of array , 1st with the whole array set, 2nd with the first 10 array (2nd is the displayed in the UI). I have implemented the search for the list view.

But i need to search from the whole list of array.

<form class="searchbar searchbar-init" data-search-list=".list-block-search" data-search-in=".item-title" data-found=".searchbar-found" data-not-found=".searchbar-not-found">
                    <div class="searchbar-input">
                       <input type="search" placeholder="Search">
                       <a href="#" class="searchbar-clear"></a>
                    </div>
                    <a href="#" class="searchbar-cancel">Cancel</a>
                 </form>
like image 404
GK_ Avatar asked Mar 17 '16 22:03

GK_


1 Answers

You need to initialize the search bar with the customSearch option set to true. See: http://framework7.io/docs/searchbar.html

Here is a getting started sample for custom search:

var searchBar = myApp.searchbar('.searchbar', {
    customSearch: true,
    onSearch: function(s) {
        console.log('Searching', s);
    },
    onClear: function(s) {
        console.log('Clearing', s);
    }
});
like image 65
jonjbar Avatar answered Oct 24 '22 01:10

jonjbar