hi i'm little confused with request.
...
model:
db.define_table('menu',
....
Field('parent',type='integer', requires=IS_EMPTY_OR(IS_IN_DB(db, 'menu.id',
'%(title)s'))),
Field('title', type='string',label=T('Title')),
Field('content', type='text',label=T('Content')),
Field('menu_type', type='string', default=request.vars.mtype, writable=False
) # it's is posible to pass vars in this mode?
.....
)
def menu():
table = request.args(0)
mtype = request.vars.mtype
grid = SQLFORM.grid(db[table].menu_type == mtype,args=request.args[:1])
return dict(item=grid)
in view:
<li><a href="{{=URL('appadmin','menu', args=[db.menu],
vars={'mtype':'top'})}}">Top Menu</a></li>
<li><a href="{{=URL('appadmin','menu', args=[db.menu],
vars={'mtype':'side'})}}">Side Menu</a></li>
i want to hide row that are 'top' or ''side'', it works on select, but
when i insert a new row in table(with sqlform.grid),
i want also to hide in combobox field parent that has
menu_type=request.vars.mtype
<https://lh6.googleusercontent.com/-OZu8nKAxRO0/T3491UJ-ipI/AAAAAAAAAzs/nX7a3I1qd4A/s1600/Untitled.jpg>
<https://lh5.googleusercontent.com/-dJZiqOvsz98/T3495oBge5I/AAAAAAAAAz4/J2KqXfXvxkQ/s1600/Untitled2.jpg>