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

Auto filling tags #18

Open
hirpara opened this issue Jun 19, 2014 · 0 comments
Open

Auto filling tags #18

hirpara opened this issue Jun 19, 2014 · 0 comments

Comments

@hirpara
Copy link

hirpara commented Jun 19, 2014

i have tried to fill tags previously on initialization.
i have refer example given on website,but it doesn't work for me.
code in website is as below.

$(function () {
if(!console) {
var console = {log: function (data) {
alert(data);
}};
}

$('textarea.tagged_text_ex5').textntags({
    triggers: {'@': {uniqueTags: false}},
    onDataRequest:function (mode, query, triggerChar, callback) {
        var data = [
            { id:1, name:'Daniel Zahariev',  'img':'http://example.com/img1.jpg', 'type':'contact' },
            { id:2, name:'Daniel Radcliffe', 'img':'http://example.com/img2.jpg', 'type':'contact' },
            { id:3, name:'Daniel Nathans',   'img':'http://example.com/img3.jpg', 'type':'contact' }
        ];

        query = query.toLowerCase();
        var found = _.filter(data, function(item) { return item.name.toLowerCase().indexOf(query) > -1; });

        callback.call(this, found);
    }
});

});

help me to prefill the tags

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

1 participant