El Wed, 9 Nov 2016 15:45:55 -0800 (PST) 黄祥 <steve.van.chris...@gmail.com> escribió:
> *pls try :* > *controllers/default.py* > def modal_auth_user(): > table = db.auth_user > fields = None > target_response = '(function($) > {$("#modal_auth_user").modal("hide");}(jQuery));' > form = SQLFORM(table, fields = fields) > if form.process(formname = 'form_modal').accepted: > response.js = target_response > redirect(request.env.http_web2py_component_location, client_side = > True) elif form.errors: > response.flash = 'form has errors' > return dict(form = form) > > *views/default/index.html* > {{extend 'layout.html'}} > > {{=H3(T('Test'), _class = 'text-info') }} > > {{=LOAD('default', 'test.load', ajax = True, > target = 'test') }} > > *views/default/test.load* > {{=form}} > > <div class="modal fade" id="modal_auth_user" tabindex="-1" > role="dialog" aria-labelledby="myModalLabel"> > <div class="modal-dialog" role="document"> > <div class="modal-content"> > <div class="modal-header"> > <button type="button" class="close" data-dismiss="modal" > aria-label="Close"><span aria-hidden="true">×</span></button> > <h4 class="modal-title" id="myModalLabel">{{=DIV(T('User') ) }}</h4> > </div> > <div class="modal-body"> > {{=LOAD('default', 'modal_auth_user.load', ajax = True) }} > </div> > </div> > </div> > </div> > > best regards, > stifan > Thank you both, everything seems to work nice now, so next step would be create a plugin/widget to add a + button next to item list field. I think there was a plugin, documented on web2py slices but last time I tried didn't work for compatibility issues, so will do that by myself. Thanks for the help, and sorry for the lazy question. Marco. -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.