Hello,
I'm a web2py (2.4.16) newbie and I would like to show a SQLFORM inside a
modal div container using stupid.css. however I cannot make it work.
stupid.css works well (orange buttons) but when clicking on buttons nothing
happens…
My next step would be to css-customize the SQLFORM. Can somebody please
guide me to some reference or examples?
Thanks in advance!
thats my minified app code:
/*
models/db.py
*/
# -*- coding: utf-8 -*-
db.define_table("thing",
Field("name", "string"))
/*
controllers/default.py
*/
# -*- coding: utf-8 -*-
def index():
things = db(db.thing).select(orderby=db.thing.name)
return locals()
def add():
form = SQLFORM(db.thing)
if form.process().accepted:
response.flash = "item added."
redirect(URL('index'), client_side=True)
return locals()
def edit():
this_item = db.thing(request.args(0, cast=int)) or redirect('index')
form = SQLFORM(db.thing, this_item)
if form.process().accepted:
response.flash = "item updated."
redirect(URL('index'), client_side=True)
return locals()
/*
views/default/index.html
*/
{{extend 'layout.html'}}
list of things: <br>
<ul>
{{for thing in things:}}
{{=LI(A(thing.name, _href=URL('edit', args=thing.id), _class="btn orange",
cid='editPanel'))}}
{{pass}}
</ul>
<div id="btAddNew">
{{=A('add new ...', _href=URL('add'), cid='editPanel')}}
</div>
<div id="editPanel">
<h2>edit</h2>
<div class="modal" name="formgoeshere"></div>
<a href="#" class="close">x</a>
</div>
/*
views/default/add.html
*/
{{=form}}
/*
views/default/edit.html
*/
{{=form}}
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.