question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do I merge search functions that use different inputs

See original GitHub issue

Meteor-easy-search package uses a Blaze incorporated search input bar in the style below: {{> EasySearch.Input index=myIndex}}

Im also using Framework7, which also has a search tool that is in this format.

http://framework7.io/docs/searchbar.html#.Vs7FOX19670

So I tried to combine the 2 like this

    <div class="page">
        <!-- Search Bar -->
        <form class="searchbar">
            <div class="searchbar-input">
                 <input type="search" placeholder="Search"> <!-- the input -->
                 {{> EasySearch.Input index=myIndex}} <!-- putting here doesnt work --> 
                 {{> EasySearch.Input index=myIndex type ="search"}} <!-- trying my luck, doesnt work--> 
                <a href="#" class="searchbar-clear"></a>
            </div>
            <a href="#" class="searchbar-cancel">Cancel</a>
        </form>

            <div class="searchbar-overlay"></div>

            <div class="page-content">
                <div class="content-block searchbar-not-found"> Nothing found </div>
                <div class="list-block list-block-search searchbar-found">
                <!-- this part clashes with easy-search's code here 
                          {{#EasySearch.IfNoResults index=myIndex}}
                              <div>No results found!</div>
                           {{/EasySearch.IfNoResults}}
                      --> 
                    <ul> <!-- search results --> </ul>
                </div>
            </div>
        </div>

I tried to insert the Blaze formatted easy-search bar and it [1] screws the formatting of Framework7 bar and [2] the easy-search does not work. Im trying to search by the header of the to-do item, as well as its contents. Also search results formatting clashes too.

How should I go about the implementation? Do I use both or pick one? Im looking through search through 2 collections, the posts and the messages parked under each post.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
mervynteocommented, Mar 29, 2016

Thanks @matteodem, great help again. With the template helper above, will the below be a correct understanding? Im using easy-search to search, but with FW7 clear and cancel buttons, as well as FW7 search bar UI formatting. Not sure how do I bring out in html the cancel and clear functions of FW7.

 <form class="searchbar">
      <div class="searchbar-input">
           <!-- <input type="search" placeholder="Search">  FW7 input format, removed -->
           {{> EasySearch.Input index=myIndex attributes=attributes}}
           <a href="#" class="searchbar-clear"></a>  <!-- need to remove? will it be in the {{>}}? --> 
     </div>
     <a href="#" class="searchbar-cancel">Cancel</a>  <!-- need to remove? will it be in the {{>}}? -->
 </form>
Template.myTemplate.helpers({
  attributes: function () {
    return { 
       type: 'search',
       placeholder: 'search here',
       class: {
            'searchbar-clear', 
           'searchbar-cancel'
       }
    };
  }
});
1reaction
matteodemcommented, Mar 23, 2016

How did you try to put in the search components? Please give me the same html code with the components in there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Merge Search Results From Multiple Field Inputs
Consider your deviceName field is the first column then you can write like this to search in this column only $(document).ready(function(){ ...
Read more >
Merge Sort Algorithm - GeeksforGeeks
It divides input array in two halves, calls itself for the two halves ... list and then combine them into another list in...
Read more >
Learn to combine multiple data sources (Power Query)
In Data Preview, select the ProductID, ProductName, CategoryID, and QuantityPerUnit columns (use Ctrl+Click or Shift+Click). Select Remove Columns > Remove ...
Read more >
Combining Datasets: Merge and Join | Python Data Science ...
The pd. merge() function recognizes that each DataFrame has an "employee" column, and automatically joins using this column as a key. The result...
Read more >
Merge (Data Management)—ArcGIS Pro | Documentation
Use this tool to combine datasets from multiple sources into a new, single output dataset. All input feature classes must be of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found