Daniel, 2012/7/10 Daniel Gonzalez <gonva...@gmail.com>: ... > myjs = 'parent.jQuery("#%s").bind("change", this.change);' % (self.myid) > Uncaught TypeError: unbound method change() must be called with > MySelect2TaggingComponent instance as first argument (got '[object Object]' > instead) > > myjs = 'parent.jQuery("#%s").bind("change", self["change"]);' % (self.myid) > Uncaught TypeError: unbound method change() must be called with > MySelect2TaggingComponent instance as first argument (got '[object Object]' > instead) > > myjs = 'parent.jQuery("#%s").bind("change", change);' % (self.myid) > jQuerySelect2 AttributeError: change is not defined
Just a quick thought: have you tried running your example with pyjd instead of pyjs? If that works there may be a Python stack trace that helps much more than the "Uncaught TypeError:" error message that come from ... whom? Can you try? Peter > You can see the code (not yet working) in my fork: > https://github.com/gonvaled/pyjs/blob/master/examples/jquery-select2/jQuerySelect2.py#L45 > > You can compile the jquery-select2 example like this: python jquery-select2 > --download (in the examples directory). Output goes to examples/__output__ > > Br, > Daniel > > On Saturday, July 7, 2012 9:56:36 PM UTC+2, istvan.vago wrote: >> >> Daniel, >> try this: >> >> from __pyjamas__ import wnd >> >> class MySelect2TaggingComponent(HTML): >> >> def change(self): >> ... >> >> wnd().change=change >> >> The change method will be accessible from jQuery as "change". >> >> Istvan