/// class PD.Web.UI.Controls.ViewGridExportFormattedCommand

PD.Web.UI.Controls.ViewGridExportFormattedCommand =
PD.Web.UI.Controls.ViewGridCommand.extend({

    //===================================
    // PUBLIC METHODS
    //===================================

    setDefaults: function () {
        this._super();
        this.props("id", "view-grid/export-formatted");
        this.props("enabled", true);
        this.props("icon", "upload-alt.14px.font");
        this.props("label", "Export (Formatted)");
        this.props("tooltip", "Export (Formatted)");
    },

    execute: function (e) {
        this._super(e);

        PD.Web.Utilities.DownloadManager.download("~/view/export", {
            viewStateId: this.get_viewStateId(),
            format: true,
            contextualFilters: JSON.stringify(this.get_viewGrid().getContextualFilters())
        });

    }

});