On Friday, September 16, 2011 8:06:45 PM UTC-4, rami wrote:
>
> 1) Yes, I tried adding the plugin that way. Followed the steps under
> adding LayoutPlugin in Chapter 13 and it does not work.
>
> I have a layout.html inside my plugin folder under the view and I
> included this
>
> {{
> response.files.insert(0,URL('static','plugin_jQueryUi/css/
> custom-theme/jquery-ui-1.8.11.custom.css'))
> response.files.insert(1,URL('static','plugin_jQueryUi/js/
> jquery-1.5.2.min.js'))
> response.files.insert(2,URL('static','plugin_JQueryUi/js/
> jquery-ui-1.8.11.custom.min.js'))
> }}
>
> and it does not work. (This layout.html file is just a simple html
> file that tries a few of the widgets that comes with jqueryui)
>
response.files is processed by a function called response.insert_files(),
which is called in web2py_ajax.html. So, you either need to {{include
'web2py_ajax.html'}} in the head of your layout.html, or you need to add
response.insert_files() at the end of that block of code above. If you
include 'web2py_ajax.html', keep in mind that it already inserts jQuery for
you (the version that comes with web2py), so you wouldn't want to repeat
that in your own response.files inserts.
(Actually, now that I think about it, response.insert_files() is something
new in trunk that will be released soon. The current version includes the
expanded code that has now been moved to response.insert_files(), so until
1.99 is released soon, you would either have to simply include
web2py_ajax.html, or copy the relevant code from it into your layout.html
head.)
> 3)
> Since I am so new with ajax and JqueryUi and web2Py, I do not
> understand what happens in the web_ajax.js and so I I might just not
> wanna use all that web2py already gives.
> Can I just start from scratch with a simple layout that I have, use
> the JQueryUI widgets however I want and then use Ajax later?
> What would be your suggestion on this one?
>
Yes, you can do that -- just take note of the above.
Anthony