/// class PD.Web.UI.Controls.GridTextboxColumn
/// using PD.Web.UI.Controls.GridColumn

PD.Web.UI.Controls.GridTextboxColumn =
PD.Web.UI.Controls.GridColumn.extend({

    //===================================
    // CONSTRUCTOR
    //===================================

    init: function (options) {

        this._super($.extend({
            width: 26,
            title: "&nbsp;",
            template: $.proxy(this.template, this),
            transform: function (data, settings) {
                return data[settings.field];
            },
            attributes: {
                style: "padding:0;text-overflow:clip;background-color:white;",
            }
        }, options));

        this.properties().appendToValue("attributes.class", this.properties("class"), " ");

    },

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

    template: function (data) {

        var value = this.properties("transform")(data, this.properties().getAll());

        var result = [
            "<div style='height:25px;background-color:#FF0000;border:0;position:relative;'>",
                "<input type='text' style='width:100%;margin-top:0;border-width:0;box-sizing:border-box;height:25px;background-color:#FFFFFF;border-color:red;border-style:solid;padding:0 5px 0 5px;' value='" + value + "'/>",
            "</div>"
        ];

        return result.join("");

    }

});