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

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

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

    get_columnId: function () {
        return this.state("columnId");
    },

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

    setDefaults: function () {
        this._super();
        this.props("visible", true);
        this.state("columnId", null);
    },

    setState: function (state) {
        this._super(state);
        this.props("enabled", this._isEnabled());
    },

    //===================================
    // PROTECTED METHODS
    //===================================

    _isEnabled: function () {
        return this.get_viewGrid() != null && this.get_columnId() != null;
    }

});