nevermind. Figured this one out. It does take you away from the page 
though. Or so it seams like.


On Wednesday, April 4, 2018 at 4:33:15 PM UTC-7, greenpoise wrote:
>
> how can I test this? I tried following your example. Trying to accomplish 
> the same. Thanks
>
> On Thursday, March 22, 2018 at 3:33:29 AM UTC-7, 黄祥 wrote:
>>
>> perhaps you can do it with bootstrap modal (in views) and dal table 
>> constructor comment
>> *e.g. (not tested)*
>> *models/db.**py*
>> db.Firmware.DeviceID.comment = A(_class="glyphicon glyphicon-plus-sign", 
>> **{"_data-toggle":"modal", "_data-target":"#modal_device"} )
>>
>> *controllers**/default.**py*
>> def modal_device():
>>  table = db.Device
>>  fields = None
>>  target_response = '(function($) 
>> {$("#modal_device").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)
>>
>> def firmware():
>>  table = db.Firmware
>>  grid = SQLFORM.grid(table)
>>  return locals()
>>
>> *views**/default/modal_device.**load*
>> {{=form}}
>>
>> *views**/default/firmware.**html*
>> {{extend 'layout.html'}}
>> {{=grid}}
>> <div class="modal fade" id="modal_device" 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">&times;</span></button>
>>  <h4 class="modal-title" id="myModalLabel">{{=DIV(T('Device') ) }}</h4>
>>  </div>
>>  <div class="modal-body">
>>  {{=LOAD('master_marketing', 'modal_device.load', ajax = True) }}
>>  </div>
>>  </div>
>>  </div>
>> </div>
>>
>>
>> best regards,
>> stifan
>>
>

-- 
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.

Reply via email to