dinc5150 / UIOMatic-Addons-Export

Addon for UIOMatic to allow exporting of List View data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build status NuGet release

Daves Updates!!!

This version uses CSV as the default export option and adds headers

Download release

UIOMatic-Addons-Export

Addon for UI-O-Matic to allow exporting of List View data

##Usage## Just populate the ListViewActions parameter on your UIOMatic attribute with the Actions you wish to supply

ListViewActions = new[]{ typeof(ExportAction)})]

Now you should get an addditional actions dropdown with the Export option

##Full Example##

using System;
using System.ComponentModel.DataAnnotations;
using UIOMatic.Attributes;
using UIOMatic.Enums;
using UIOMaticAddons.Export;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.DatabaseAnnotations;

namespace TestUIOMaticExport.Models{

[TableName("ContactEntries")]
[PrimaryKey("Id", autoIncrement = true)]
[UIOMatic("contactentries", "Contact Entries", "Contact Entry", 
    FolderIcon = "icon-users",
    SortColumn = "Created", SortOrder = "desc",
    RenderType = UIOMaticRenderType.List,
    ListViewActions = new[]{ typeof(ExportAction)})]
public class ContactEntry
{
    [PrimaryKeyColumn(AutoIncrement = true)]
    public int Id { get; set; }

    [Required]
    [UIOMaticListViewField]
    [UIOMaticField]
    public string Name { get; set; }

    [Required]
    [EmailAddress]
    [UIOMaticListViewField]
    [UIOMaticField]
    public string Email { get; set; }

    [SpecialDbType(SpecialDbTypes.NTEXT)]
    [Required]
    [UIOMaticListViewField]
    [UIOMaticField(View = UIOMatic.Constants.FieldEditors.Rte)]
    public string Message { get; set; }

    [UIOMaticListViewField(Config = "{'format' : '{{value|relativeDate}}'}")]
    [UIOMaticField(View = UIOMatic.Constants.FieldEditors.DateTime)]
    public DateTime Created { get; set; }
}
}

About

Addon for UIOMatic to allow exporting of List View data

License:MIT License


Languages

Language:JavaScript 75.9%Language:HTML 13.3%Language:ASP 5.0%Language:CSS 4.4%Language:XSLT 0.8%Language:C# 0.6%Language:Batchfile 0.0%