mjtrac
mjtrac

Reputation: 187

where can I find a working example of jqueryui in plone

Where can I find a working example of jqueryui in plone. It would be nice to use one as a starting point.

Upvotes: 1

Views: 381

Answers (1)

mjtrac
mjtrac

Reputation: 187

Well, it's there already, at least in version 1.8.16.9 (and, presumably, greater) of collective.js.jqueryui.

If your site includes collective.js.jqueryui, you can do as follows:

Go to: Zope Management Interface >> portal_properties >> jqueryui_properties

Click the checkbox by example_activated to set it True, click save, confirm checkbox is still checked.

Go to any URL at your site and append "/example.jqueryui." This will show you a jqueryui accordion, buttons, shadows, dialogs, etc... (Your actual URL could look like: "http://localhost:8080/My_Plone_Site/example.jqueryui")

You will see working example code if you have collective.js.jquery-1.8.16.9-py2.7.egg. You'll find it in the egg's collective/js/jqueryui/example.py and example.pt files.

If you have an omelette, go to parts/omelette/collective/js/jqueryui/example.pt for the page template. Note the line:

This line is including the returned string from the function javacript in file parts/omelette/collective/js/jqueryui/example.py, which begins:

def javascript(self):
    return """jQuery(function(){
// Accordion
jq("#accordion").accordion({ header: "h3" });
// Autocomplete
jq("#autocomplete").autocomplete({
    source: ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl"]
});
// Button
jq("#button").button();
jq("#radioset").buttonset();
// Tabs
jq('#tabs').tabs();
etc..."""

Upvotes: 1

Related Questions