Getting a jQuery UI combobox to render

475 views
Skip to first unread message

Brian Mingus

unread,
Jan 10, 2014, 6:44:39 PM1/10/14
to meteo...@googlegroups.com
I'm using a jQuery UI autocomplete + scrollable combobox. I've got it working with one major exception: I have to run $("#combobox").combobox() in the chrome console to get it to render. I've tried sticking it in my template's rendered function, at the end of the client, etc., but so far the chrome console is the only place that I can get it to work.

Igal Tivoni

unread,
Jan 12, 2014, 9:00:54 PM1/12/14
to meteo...@googlegroups.com
This sounds similar to an issue I have with the tagsinput plugin, also posted on stackoverflow. In this post I've mentioned a workaround which might work in your case as well

Brian

unread,
Jan 12, 2014, 9:03:38 PM1/12/14
to meteo...@googlegroups.com
I'm not sure what the workaround you are mentioning is, but what I noticed was that my template's rendered method was being called twice. I also noticed that when I put $("#combobox").combobox() inside my template's rendered code, it neither rendered in the browser, nor would it render when I then ran that code in the chrome console. It was only when Meteor was not responsible for running the code and I ran it in the chrome console that it rendered.

This suggested to me that the first time my template's rendered method was being called the interface was not ready. Thus, I inserted a counter and made sure that the combobox() method was only called the second time my template's rendered method was called.

I must say this was challenging to debug - too challenging IMHO!


--
You received this message because you are subscribed to a topic in the Google Groups "meteor-talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/meteor-talk/B00WuvRtGKs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to meteor-talk...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Igal Tivoni

unread,
Jan 13, 2014, 2:22:17 AM1/13/14
to meteo...@googlegroups.com
do you know if the combobox component can be initialized twice and still work as expected?
Just an idea here. If it can't, that can explain why the component is not visible if multiple 'rendered' calls occur
Reply all
Reply to author
Forward
0 new messages