'use strict';

/**
 * @implements dataModelAPI
 * @param {Hypergrid} grid
 * @param {object} [options]
 * @param {string} [options.name]
 * @constructor
 */
function FilterSubgrid(grid, options) {
    this.grid = grid;
    this.behavior = grid.behavior;

    /**
     * @type {dataRowObject}
     */
    this.dataRow = {}; // for meta data (__HEIGHT)

    if (options && options.name) {
        this.name = options.name;
    }
}

FilterSubgrid.prototype = {
    constructor: FilterSubgrid.prototype.constructor,

    type: 'filter',

    format: 'filter', // override column format

    getRowCount: function() {
        return this.grid.properties.showFilterRow ? 1 : 0;
    },

    getValue: function(x, y) {
        return this.behavior.filter.getColumnFilterState(this.behavior.getColumn(x).name) || '';
    },

    setValue: function(x, y, value) {
        this.behavior.filter.setColumnFilterState(this.behavior.getColumn(x).name, value);
    },

    getRow: function(y) {
        return this.dataRow;
    }
};

module.exports = FilterSubgrid;

@@ -737,67 +737,29 @@
 ior.
-filter.getColumnFilterState(this.behavior.getColumn(x).name
+dataModel.getFilter(x
 ) %7C%7C
@@ -835,67 +835,29 @@
 ior.
-filter.setColumnFilterState(this.behavior.getColumn(x).name
+dataModel.setFilter(x
 , va

call API methods instead of filter methods directly