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

Method request: removeAllTags() #186

Open
Fabryprog opened this issue Aug 6, 2015 · 3 comments
Open

Method request: removeAllTags() #186

Fabryprog opened this issue Aug 6, 2015 · 3 comments

Comments

@Fabryprog
Copy link

Hello everyone,

today i will loop current tags to remove them

It would be nice to have a method "removeAllTags()"

King regards

@sneha27
Copy link

sneha27 commented Aug 7, 2015

Try using clear plugin..
Or add below code for some event

someevent: {
var self = jQuery(this);

    // check if the tags plugin is present
    if(typeof self.core()._plugins.tags != 'undefined')
    {
        // it is! remove all tags 
        var elems = self.core()._plugins.tags.tagElements();
        for(var i =0; i < elems.length;i++)
        {
            self.core()._plugins.tags.removeTag($(elems[i]));
        }
    }
    // clear the text from the search area
    self.val('');
    self.core().getFormData();

}

@Fabryprog
Copy link
Author

@sneha27 yours is a workaround!

I created this issue to delete this horrible workaround in my source code 👍

@Fabryprog
Copy link
Author

+1

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

2 participants