Skip to main content

Jquery javascript library for TurboGears

Project description

Feature
===============

jquery is a jquery javascript library wrapper and ajax helper for happy
TurboGears web designers.

It contains 3 extra ajax widgets based on jquery.

* addCallback / link_to_remote(target ,update, href, callback)

* addPeriodBack / periodically_call_remote(update, href, interval)

* addFormback / form_remote_tag(target, update, href)

Which are inspired from Ruby on Rails/pquery and give them the twisted syntax.


Available widgets
====================

* Jquery (basic jquery libray wrapper for Turbogears)

* addCallback/link_to_remote

* addPeriodBack/periodically_call_remote

* addFormback/form_remote_tag

.. note::
Update notice form 1.1.2 jquery widget: you need return dict(link = link_to_remote) instead of
return dict(link = link_to_remote()) in the following versions


Install
==============
Use setuptools to install::

$easy_install jquery


Usage
==============

jquery
~~~~~~~~~

include in config/app.cfg::

tg.include_widgets = ['jquery.jquery']

jquery ajax
~~~~~~~~~~~~~

import in controllers.py::

from jquery import addCallback
from jquery import addPeriodback
from jquery import addFormback
....
return dict(addCallback = addCallback,
addPeriodback = addPeriodback)


in template::

[div id="timelink"][a href = "#"]get time[/a][/div]
[div id="timediv"][/div]
${addCallback(target="timelink" ,update="timediv", href="/time")}

or::

[div id="timediv"][/div]
${addPeriodback(update="timediv", href="/time", interval="3000")}

or

[form class="timelink" action="ajax" method="get" ]
Field : [input type="text" name="field" /][br /]
[input type="submit" /]
[/form]
[div id="timediv"][/div]
${addFormback(target="timelink", update="timediv", href="ajax")}

The addCallback/addPeriodback(link_to_remote/periodically_call_remote) could be placed anywhere in your template.
Check http://docs.turbogears.org/1.0/RemoteLink for detail.

Reference
============

- jquery 1.2.1 http://jquery.com
- pquery http://www.ngcoders.com/pquery/

History
=============
1.2.1:

* update to jquery 1.2.1
* remove jqueryext support

1.1.2w2:

* new twisted style ajax call
* new addFormback/form_remote_tag call
* passing ajax function no need extra '()' at all.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jquery1.2.1a.zip (33.9 kB view hashes)

Uploaded Source

Built Distribution

jquery-1.2.1a-py2.5.egg (99.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page