/// class PD.Web.UI.Controls.ViewGridResetCommand
/// using PD.Web.UI.Controls.ViewGridCommand

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

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

    setDefaults: function () {
        this._super();
        this.props("id", "view-grid/reset");
        this.props("enabled", true);
        //this.props("icon", PD.Path.to16x16("columns.png"));
        this.props("label", "Reset");
        this.props("tooltip", "Reset");
    },

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

        var that = this;

        PD.ajax({
            type: "POST",
            url: PD.Path.resolve("~/view/reset?") + $.param({
                viewStateId: this.get_viewStateId()
            }),
            success: function () {
                PDJS.Shared.MessageStack.instance.success("View reset successfully.")
                that.get_viewGrid().build();
            }
        });
    }

});