javascript - Unchecking checkbox during live search with Blaze in Meteor JS -
I'm trying to simulate a live search with meteorite JS (BTW, surprisingly hard work!)
This is in client.js :
Template.newDiagnostic.events ({"keyup .entry-search": function (e) {Session .set ("search query", function (value) {var query = new regExp (session .get ("search-query")) return query.test (value)}} Template. NewDiagnostic.helpers ({symptoms: function (return symptoms.find ({}}}}) Actually, I have an event, I look at the key in search A. Input, next to changing a session variable, I have registered an assistant to check whether a given string match (RegExp) is finally available, to provide data only. Then , I have this in my HTML:
name = "new diagnostic" & gt; & lt; input type = "text" category = "form-control entry-search "Placeholder =" Fillatar por Nom "& gt; {{#each symptoms}} {{#if searchQuery name}} & lt; Div class = "checkbox" & gt; & Lt; Label & gt; & Lt; Input class = "checkbox-type" type = "checkbox" value = "{{_}}}" gt; {{Name}} & lt; / Labels & gt; & Lt; / Div & gt; {{/ If}} {{/ each}} & lt; / Template & gt;
Here, I try to filter conceal (entries) in the query.
The simulation of Live Search works fine till now: You type something in that input text and the entries are filtered. The problem is that when you search something and check an entry After that, if you search for another word and check that one, then your first checked insertion has ended. I do not want this behavior. I want to search for an entry, check it, search for another entry, check it as well and do it like that.
I think the problem is to do with reloading the template, but I do not think how to do this work. I thought about saving the entries checked in a session variable, but This will be my last option. I also tried the matode: easy search , but the problem is the same.
Comments
Post a Comment