Basically you use the template to create the *inline* javascript which
instantiates the javascript widget object. It isn't pretty, but I think
its the only way to get the data into the javascript world without
resorting to dynamic generated .js files.
Eg:
class Progressbar(Widget):
""" Shows the status of a long running process.
"""
template = """<div id="${id}" class="progressbar"
xmlns:py="http://purl.org/kid/ns#">
<span class="bar" style="width: ${width}">${width}</span>
<script language="JavaScript"
type="text/JavaScript">progressbar${id} = new Progressbar( "${id}",
"${controller}", ${polling_interval})</script>
</div>"""
params = ["controller", "id", "polling_interval", "width"]
id = 'default'
polling_interval = 'dynamic'
width = "0%"
controller = ""
javascript = [mochikit,
JSLink("progressbar.javascript","progressbar.js")]
css = [CSSLink("progressbar.css","progressbar.css")]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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
-~----------~----~----~----~------~----~------~--~---