Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Change tokenize dataSource #91

Open
lailaabb opened this issue Jan 31, 2022 · 1 comment
Open

Change tokenize dataSource #91

lailaabb opened this issue Jan 31, 2022 · 1 comment

Comments

@lailaabb
Copy link

Hello,
is it possible to change the tokenize dataSource url on a trigger?

@dragonofmercy
Copy link
Owner

Hi, I have no idea just now, you can try to do something with this snippet

$('.tokenize-callable-demo1').tokenize2({
    dataSource: function(search, object){
        $.ajax('remote.php', {
            data: { search: search, start: 1 },
            dataType: 'json',
            success: function(data){
                var $items = [];
                $.each(data.data, function(k, v){
                    $items.push(v);
                });
                object.trigger('tokenize:dropdown:fill', [$items]);
            }
        });
    }
});

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

No branches or pull requests

2 participants