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

jQuery error #22

Open
denen99 opened this issue Oct 31, 2012 · 14 comments
Open

jQuery error #22

denen99 opened this issue Oct 31, 2012 · 14 comments

Comments

@denen99
Copy link

denen99 commented Oct 31, 2012

using jquery 1.7.2 and jqueryUI when using the autocomplete option i keep getting the error

Error: cannot call methods on autocomplete prior to initialization; attempted to call method 'option'

Any ideas what would cause this? I made sure jquery and jqueryUI were loaded first but still no luck.

@Renari
Copy link

Renari commented Nov 29, 2012

I'm having the same problem with jquery 1.8.2 and jqueryui 1.9.2.

@javierdallamore
Copy link

I'm having the same problem with jquery 1.8.3 and jqueryui 1.9.2

@manuganji
Copy link

Even I am getting this error. Could anyone fix it?

@PazkaL
Copy link

PazkaL commented Dec 6, 2012

Have the same issue, downgrading to jquery ui 1.8.24 fixed it for me

@ioncache
Copy link
Owner

ioncache commented Dec 6, 2012

All right, apparently this is a common issue =)

I'll take a look at it this weekend then and see if I can fix it up for all versions of jQuery. Possibly just v1.6 and higher.

@ghost
Copy link

ghost commented Jan 9, 2013

There is no inicialization of autocomplete. Just add: $(inputField).autocomplete({ source: tags.availableTags }); before line 331 (and maybe similiar other lines).

@NoelLH
Copy link

NoelLH commented Jan 15, 2013

This seems specific to jQuery UI 1.9 branch.

Latest jQuery 1.8 with UI 1.8 works OK, but jQuery 1.8 with UI 1.9 is broken.

wshafer pushed a commit to wshafer/Tag-Handler that referenced this issue Jan 23, 2013
@alok108
Copy link

alok108 commented Jan 30, 2013

@wshafer but it still do not work for me I am getting this error still
Uncaught Error: cannot call methods on autocomplete prior to initialization; attempted to call method 'option'
Capture

@wshafer
Copy link

wshafer commented Feb 6, 2013

@alok108 - Sorry for the delay. I'm no longer getting the error. What does your initialization look like so I can recreate the problem on this end?

In other words how are you calling the tagger? $("#someSelector").tagHandler({ ?? })

@pilec
Copy link

pilec commented Feb 13, 2013

I've got same problem, jQuery: 1.8.0, jQuery UI 1.9.2

Initialization

$(document).ready(function () {
    $(".tag-food").each(function(key,tagInput) {
        tagInput = $(tagInput);
        $(this).tagHandler({
            assignedTags: tagInput.data('tags'),
            getURL: tagInput.data('getURL'),
            onAdd: function (tag) {
                }
                $.getJSON(tagInput.data('addurl'), { foodId: tagInput.data('foodid'), tag: tag });
            },
            onDelete: function (tag) {
                $(this).hide();
                $.getJSON(tagInput.data('deleteurl'), { foodId: tagInput.data('foodid'), tag: tag });
            },
            autocomplete: true,
            availableTags: [ 'C', 'C++', 'C#', 'Java', 'Perl', 'PHP', 'Python' ],
            minChars: 1
        })
    });
});

without autocomplete: true works fine.

@wshafer
Copy link

wshafer commented Feb 13, 2013

Thanks for the info. I tested using the same approach as above, and it worked for me. So couple of questions to see why it's working for me and not for you.

  1. Did you make sure to clone from my fork? The pull request that I sent to fix this has not been merged with the main repo. So you'll need to use mine.

  2. Are you using the minified version? If you are try the unminified version and see if it works with that one. I did not fix the minified version in my repo. I can, but I assumed that this would be corrected when the next version comes out and my changes are merged (or dumped).

Let me know if the above fixed it for you. If not I'll keep digging.

Thanks,
Westin

@pilec
Copy link

pilec commented Feb 13, 2013

Oh, I use minified version, in unminified is everything okay.
Thanks for help, you're doing a really good job!

@wshafer
Copy link

wshafer commented Feb 13, 2013

Awesome. It seems that is causing a bit of confusion. I'm going to minify my version and push that to the repo to keep this issue from coming up again. I'll let you know when the minified version is corrected.

Thanks for the feedback,
Westin

@rockrockrock3
Copy link

Hi, to clear all tags, i am resetting the tag handler like below

("#array_tag_handler").tagHandler({
assignedTags: asnTags,
availableTags: avlTags,
autocomplete: true});

it worked fine. But the problem with this is, when i add one of the available tag and deleting the same tag giving me the error like Uncaught cannot call methods on autocomplete prior to initialization; attempted to call method 'option'.

how to fix it?

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