*Add and edit button links are created incorrectly when de grid is inside 
another view. With the smartgrid works ok.*

*Add button link*
http://localhost:8000/erp_proto/tablas_grales/index/addt/forma_pago             
           
Return None

*Should be*
http://localhost:8000/erp_proto/tablas_grales/index/forma_pago/add/forma_pago

*Edit button link*
http://localhost:8000/erp_proto/tablas_grales/index/edit/forma_pago/1           
             
Return None

*Should be*
http://localhost:8000/erp_proto/tablas_grales/index/forma_pago/edit/forma_pago/1



*CONTROLLER*
def index():

    if request.args(0) == 'forma_pago':
        grid = SQLFORM.grid(db.forma_pago, csv=False, user_signature=False, 
details=False, advanced_search=False)
        return dict(grid=grid, enc='Formas de Pago')

    if request.args(0) == 'vendedores':
        grid = SQLFORM.grid(db.vendedores, csv=False, user_signature=False, 
details=False, advanced_search=False)
        return dict(grid=grid, enc='Vendedores')

    if request.args(0) == 'tipo_documento':
        grid = SQLFORM.grid(db.tipo_documento, csv=False, 
user_signature=False, details=False, advanced_search=False)
        return dict(grid=grid, enc='Tipos de Documento')

    if request.args(0) == 'situacion_iva':
        grid = SQLFORM.grid(db.situacion_iva, csv=False, 
user_signature=False, details=False, advanced_search=False)
        return dict(grid=grid, enc='Situaciones IVA')

*VIEW*

{{extend 'layout.html'}}

<div>
<h4>TABLAS GENERALES</h4>    
<div class="breaker"></div>
<h4 >
{{=A('FORMAS PAGO'    , _href=URL('tablas_grales','index', 
args='forma_pago')    , _class="btn btn_secondary")}}
{{=A('VENDEDORES'     , _href=URL('tablas_grales','index', 
args='vendedores')    , _class="btn btn_secondary")}}
{{=A('TIPOS DOCUMENTO', _href=URL('tablas_grales','index', 
args='tipo_documento'), _class="btn btn_secondary")}}
{{=A('SITUACION IVA'  , _href=URL('tablas_grales','index', 
args='situacion_iva') , _class="btn btn_secondary")}}
</h4>
</div>

<div class="breaker"></div>

<hr/>
<h4>{{=enc}}</h4>
{{=grid}}
</div>
</div>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/88b800d4-ee62-4f84-a3c7-e05f8c660308%40googlegroups.com.

Reply via email to