/// class ProspectDirector.Modules.Views.ViewFilterFinderDialog
/// using ProspectDirector.Types.View.Finder

/**
The module for the View Filter Finder Dialog.
@class ViewFilterFinderDialog
@namespace ProspectDirector.Modules.Views
**/
ProspectDirector.Modules.Views.ViewFilterFinderDialog = (function (options) {

    var 

    //---------------------------
    //--- COMPONENTS
    //---------------------------

    COMPONENTS = {

        finder: null

    },

    //---------------------------
    //--- PRIVATE MEMBERS
    //---------------------------

    PRIVATE = {

        /**
        @method init
        @private
        **/
        init: function () {

            options = $.extend({
            }, options);

            COMPONENTS.finder = new ProspectDirector.Modules.Views.ViewFilterFinderDialog.Finder(options);

        }

    },

    //---------------------------
    //--- PUBLIC MEMBERS
    //---------------------------

    PUBLIC = {
    };

    PRIVATE.init();

    return PUBLIC;

});

/**
@class Finder
@namespace ProspectDirector.Modules.ViewFilterFinderDialog
@extends ProspectDirector.View.Finder
**/
ProspectDirector.Modules.Views.ViewFilterFinderDialog.Finder = ProspectDirector.Types.View.Finder.extend({

    //---------------------------
    //--- OVERRIDDEN METHODS
    //---------------------------

    _okButton_onClick: function (sender, e) {

        var selected = this._getSelectedRows(),
            dataRows = [];

        for (var i = 0; i < selected.length; i++) {
            var row = this._getRow(selected[i]);
            dataRows[dataRows.length] = {
                id: row.id,
                name: row.name,
                enabled: true,
                operator: 0,
                value: null,
                verse: null
            };
        }

        this.get_dialog().data("dialog").hide({
            command: "ok",
            data: dataRows
        });

    }

});
