How can you remove the text "Export" from a grid??

64 views
Skip to first unread message

Andrea Fae'

unread,
Sep 7, 2017, 6:54:48 AM9/7/17
to web2py-users
I don't want any export and I dont' want the text "export" in the bottom of the grid...

Martin Weissenboeck

unread,
Sep 7, 2017, 7:06:02 AM9/7/17
to web2py-users
I think grid(....exportklasses=None) or grid(.... exportclasses=dict(xml=false, csv=False,, html=False, tsv=False) should do the job. I have not tried it.

From the book:


  • exportclasses takes a dictionary of tuples: by default it's defined as
1
2
3
4
5
6
csv_with_hidden_cols=(ExporterCSV, 'CSV (hidden cols)'),
csv=(ExporterCSV, 'CSV'),
xml=(ExporterXML, 'XML'),
html=(ExporterHTML, 'HTML'),
tsv_with_hidden_cols=(ExporterTSV, 'TSV (Excel compatible, hidden cols)'),
tsv=(ExporterTSV, 'TSV (Excel compatible)'))

ExporterCSV, ExporterXML, ExporterHTML and ExporterTSV are all defined in gluon/sqlhtml.py. Take a look at those for creating your own exporter. If you pass a dict like dict(xml=False, html=False) you will disable the xml and html export formats.


2017-09-07 12:54 GMT+02:00 Andrea Fae' <and...@gmail.com>:
I don't want any export and I dont' want the text "export" in the bottom of the grid...

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



​Regards Martin​

andfae

unread,
Sep 7, 2017, 7:24:06 AM9/7/17
to web...@googlegroups.com
No...I just tested both

You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/df2TbGtB65Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.

黄祥

unread,
Sep 7, 2017, 7:41:38 AM9/7/17
to web2py-users
had you tried :
csv = False

best regards,
stifan

andfae

unread,
Sep 7, 2017, 7:42:38 AM9/7/17
to web...@googlegroups.com
Yes

--

Anthony

unread,
Sep 7, 2017, 10:38:56 AM9/7/17
to web2py-users
Can you show your code, a screenshot, and explain exactly what you are trying to achieve. If I do SQLFORM.grid(..., csv=False), I see no export links.

Anthony

Andrea Fae'

unread,
Sep 9, 2017, 1:28:12 PM9/9/17
to web2py-users
    exportcls = dict(csv=False, xml=False, csv_with_hidden_cols=False, html=False, json=False, tsv_with_hidden_cols=False, tsv=False)

        form = SQLFORM.grid(query, args=[studente], fields=[db.evento.titolo, db.evento.ricorrenza, db.evento.giorno_inizio, db.evento.inizio,db.evento.fine,db.evento.risorsa, db.evento.materia,db.evento.docente], headers=headers, create=False, details=False, editable=False, deletable=False, maxtextlength=60, exportclasses = exportcls)


SEE ATTACHED FILE.
Thank you
Yes

To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
esporta.JPG

Anthony

unread,
Sep 9, 2017, 3:53:47 PM9/9/17
to web2py-users
I don't see csv=False in your grid call: SQLFORM.grid(..., csv=False). You don't have to bother with exportclasses if you set csv=False.

Anthony

Andrea Fae'

unread,
Sep 10, 2017, 3:34:27 AM9/10/17
to web2py-users
You are right, like the same! But, where is it written?
Thanks a lot

Anthony

unread,
Sep 10, 2017, 9:48:55 PM9/10/17
to web2py-users
On Sunday, September 10, 2017 at 3:34:27 AM UTC-4, Andrea Fae' wrote:
You are right, like the same! But, where is it written?

Reply all
Reply to author
Forward
0 new messages