10379 Posts in 2194 Topics by 1710 members
| Go to End | Next > | |
| Author | Topic: | 2915 Views |
-
ModelAdmin & CSV Export issue?

14 May 2010 at 10:07pm Last edited: 14 May 2010 10:08pm
Hi,
I've searched the forums/documentation and can't find any info on this...
With the ModelAdmin export to CSV function, is it possible to export more than just the summary fields that are displayed?
When my client is using the system it is only sufficient for them to see 4 or 5 summary fields of the DataObject but would like to be able to export ALL fields of the DataObject to CSV. I've had a look at http://doc.silverstripe.org/tablelistfield but don't know how to tie this into the default CSV Export button in modeladmin, or if I need to create a custom CsvQuery?
Any help would be great!
Thanks,
Ciaran -
Re: ModelAdmin & CSV Export issue?

13 July 2010 at 3:27am
Hi,
Did you find any solution? I'm stuck with the same problem...
Thank you very much
Mercedes
-
Re: ModelAdmin & CSV Export issue?

13 July 2010 at 5:05am
Hi,
I never got it solved unfortunately
If you do manage to find a solution please post on the forum (if you get time), and I'll do the same.
Regards,
Ciarán -
Re: ModelAdmin & CSV Export issue?

13 July 2010 at 7:55am
Hi,
I have found a solution. It's not the best, but it works...
In the DataObject of the ModelAdmin I have defined the variable $summary_fields with all the fields I need in my csv file.
public static $summary_fields = array('var1','var2', 'var3');
I have also added a javascript file where I search the checkboxes in the search form (which are the same as in the summary_fields variable, and I change the state from checked to not checked. When the system creates the .CSV file, it doesn't matter if the checkbox is marked or not, it will include all fields in the CSV.
document.getElementById('id_from_the checkbox_in_the_search_form').checked = false;
I hope this will serve you.
Best regards,
Mercedes
-
Re: ModelAdmin & CSV Export issue?

13 July 2010 at 9:45pm
Great, I'll give this a go!
Thanks a lot
Regards,
Ciarán -
Re: ModelAdmin & CSV Export issue?

4 August 2010 at 9:22pm
Having the exact same requirement from a client too, anyone found a good solution to this?
-
Re: ModelAdmin & CSV Export issue?

22 October 2010 at 7:44pm
Silverstripe crashes when I run CSV export on an empty result.
Is this a core issue?
Does anybody have an idea how to fix this? -
Re: ModelAdmin & CSV Export issue?

27 October 2011 at 5:17am
Hi,
I know this is an old-ish thread but wondered if someone had come up with a fix for this and wouldn't mind sharing a bit of example code?
Cheers,
Jim
| 2915 Views | ||
| Go to Top | Next > |




