list index out of range when removing some fields in SQLFORM.grid & clicking the remaining button

28 views
Skip to first unread message

mostwanted

unread,
Feb 15, 2020, 3:13:32 PM2/15/20
to web2py-users
I am facing a little challenge here, I was able to remove some fields as I wanted from the SQLFORM.grid because I just wanted to use it Edit field alone & so i wanted it alone to be visible.

grid = SQLFORM.grid(db.professionalsummary.posted_by==user.id, editable=True, deletable=False, user_signature=True,create=False, details=False, exportclasses=dict(export=False, xml=False, html=False, json=False, csv=False, tsv=False, tsv_with_hidden_cols=False, csv_with_hidden_cols=False))
    grid
[0][1][0][0] = ' ' #remove search field
   
#grid[0][1][0][1] = '' #remove search button
    grid
[0][1][0][2] = '' #remove clear button
..............
..............

But now when I click on the edit button for the field I want to edit I get an error:

<type 'exceptions.IndexError'> list index out of range


Whats causing this error & how can I fix it??

Regards;

Mostwanted

Christian Varas

unread,
Feb 15, 2020, 7:18:57 PM2/15/20
to web...@googlegroups.com
i’m quite sure that exist a switch like “searchable=False” to disable the search field.
Usually I get this error when the attribute on sqlform that I’m trying to modified does not exist, maybe check the correct Index of the list.


Cheers.

--
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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/001f952f-9839-483c-af11-9534c403f731%40googlegroups.com.

mostwanted

unread,
Feb 16, 2020, 12:34:26 AM2/16/20
to web2py-users
I saw that on the SQLFORM.grid signature, thanks, I' now left with the "# records found" message on the right and the bottom "Export:" label at the bottom without the exportclasses
To unsubscribe from this group and stop receiving emails from it, send an email to web...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages