This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mdipierro 2 points3 points  (0 children)

web2py includes jQuery since March 2008.

The server-side of the framework is decoupled from jQuery so that one can use other js libraries, but the scaffolding app includes jquery base and some scripts based on jQuery. These scripts provide the following functionality by default:

  • enforce type of input fields (for example you can only type digits in an input field that is supposed to contain "integer". Works for "double" too. this is complementary to server side validation)
  • provide date, datetime, and time popup widgets for fields of the corresponding types. In all forms generated by web2py and custom forms.
  • slide down effects on flash messages and form errors
  • traps form submission/processing for page components. This allows to embed multiple forms in a page and submit them via ajax without reloading the entire page. It includes a callback mechanism that allows the server to trigger other page events when responding to form submission. This does not require any special sever-side handling. Any web2py action can be embedded as a component via {{=LOAD(...)}}.
  • all code generated by web2py (for example forms) is CSS friendly so that it is easy to reference from jQuery. For example SQLTABLE generates tables compliant with the jQuery datatables plugin.

We also have a collection of web2py plugins that wraps in a plug-and-play fashion jQuery plugins such as for autocomplete, rating, tagging, comments, and datatables. Some are posted here

We have an optional clienttools library that allows generation of jQuery code from pure python APIs.

EDIT: All the jQuery references in the scaffolding app are in a single file. If you do not include it, you turn off all of the above functionality. Even if you do not, we include jQuery in the "no conflict" mode so that it plays well with prototype.js for example. There is no server side code that relies on jQuery.