Hi,

Ok, I hacked and got a chart...

2009/3/21 Andrew Basson <[email protected]>:
> Hi,
>
>>
>> http://paste.turbogears.org/paste/39329
>>
> With further investigation and editing the output of the rendered
> template as a static page and trying to get that to work...
>
> It seems that tw.core.js is escaping the id of the widget and this is
> breaking tw.jquery.FlotWidget
>
> Here is a snippet from tw.core.js that shows the escaping behaviour of
> the id selector as per the paste above.
>

Ok, so I hacked __get_js_repr on _js_call and put in a replace as per below.

class _js_call(object):
    __slots__ = ('__name', '__call_list', '__args', '__called')

    def __init__(self, name, call_list, args=None, called=False):
        self.__name = name
        self.__args = args
        call_list.append(self)
        self.__call_list = call_list
        self.__called = called

    def __getattr__(self, name):
        return self.__class__(name, self.__call_list)

    def __call__(self, *args):
        self.__args = args
        self.__called = True
        return self

    def __get_js_repr(self):
        if self.__called:
            args = self.__args
            return '%s(%s)' % (self.__name, ', '.join(imap(encode,
args)).replace('\\',''))
        else:
            return self.__name

Don't know what else will break, but for now I'm happy to fall into
bed knowing I can finally produce a chart.

Cheers, Andrew.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to