Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All serach parameters are undefined #86

Closed
DavidSichau opened this issue Jun 18, 2015 · 4 comments
Closed

All serach parameters are undefined #86

DavidSichau opened this issue Jun 18, 2015 · 4 comments

Comments

@DavidSichau
Copy link

I want to use a server side autocomplete search. However the parameters to the search options are all undefined.

Here is my Template:

Template.usersTypeahead.onRendered(function () {
    console.log('rendered');
    Meteor.typeahead.inject();
});

Template.usersTypeahead.helpers({
    search: function(query, sync, callback) {
        console.log(query); //is undefined
        console.log(sync); //is undefined
        console.log(callback); //is undefined
        if(_.isString(query)) {
            Meteor.call('getUsers', query, function (err, res) {
                if (err) {
                    console.log(err);
                    return;
                }
                console.log(res);
                callback(res);
            });
        }
    },
    selected: function(event, suggestion) {
        Template.instance().userId.set(suggestion.id);
    }
})

And here the HTML

<template name="usersTypeahead">
    <div class="form-group">
    <input class="form-control typeahead" name="users" type="text"
           placeholder="Mitstudenten"
           autocomplete="off" spellcheck="off"
           data-hint="false"
           data-min-length="1"
           data-source="search" data-selected="selected"
           />
    </div>

</template>

The console looks like:

rendered
undefined
undefined
undefined
undefined
undefined
undefined

Why does the paramters are all undefined? I tried it with Version 0.10.14_14 and 0.11.1_1.

@Manto
Copy link

Manto commented Jun 22, 2015

seeing the same thing here since updating. 0.10.5_14 is the latest known working version for me.

@sergeyt
Copy link
Owner

sergeyt commented Jun 23, 2015

@DavidSichau, @Manto AFAIR last time server-side search was working in demo app in my meteor environment. I guess this could be caused with changes in internal meteor API that this package uses (e.g. Template._withTemplateInstanceFunc). I'll try to debug and fix the issue this week.

@sergeyt
Copy link
Owner

sergeyt commented Jun 26, 2015

BTW I've checked in demo app server-side search is working without observation of this issue.

@Manto
Copy link

Manto commented Jun 30, 2015

you were right @sergeyt. my issue was with kadira-debug; not this package. my bad :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants