W dniu 03.07.2012 08:40, Daniel Gonzalez pisze:
Hello,
I am trying to integrate a jQuery component with pyjs. My code looks
like this:
|
from __pyjamas__ import JS
...
classCallDetails(VerticalPanel):
def __init__(self, avatar_image, call_from, start_date, duration, own_style
='activity-call-details'):
VerticalPanel.__init__(self)
...(initialization of my vertical panel,with lots of components,and a
div with id #aa10)
self.final_setup()
def final_setup(self):
JS("""jQuery("#aa10").select2({tags:["red", "green",
"blue"]});""")
|
The javascript console is telling me:
Uncaught ReferenceError: jQuery is not defined
But I have included jQuery. This is my Activity.html:
I think it's because your "javascript compiled python code" is included
into iframe, so there is no jQuery in iframe.
I would try to do eityher
from __javascript__ import window
window.parent.jQuery("#aa10") #I'm not sure if it will work
or JS(""" window.parent.jQuery(...... """)
--
pozdrawiam
Łukasz Mach - [email protected]