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

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

    var 

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

    COMPONENTS = {

        finder: null

    },

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

    PRIVATE = {

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

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

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

        }

    },

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

    PUBLIC = {
    };

    PRIVATE.init();

    return PUBLIC;

});

/**
@class Finder
@namespace ProspectDirector.Modules.ViewColumnFinderDialog
@extends ProspectDirector.View.Finder
**/
ProspectDirector.Modules.Views.ViewColumnFinderDialog.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] = row.toJSON();
        }

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

    }

});
