
if(typeof brodos.fulltext === 'undefined') brodos.fulltext = {};
Ext.namespace("brodos.fulltext");

brodos.fulltext.Searchpanel = function (config){
    if(!config)config = {};
    this.descriptionLabel = config.descriptionLabel || brodos.translation.get('_MASK_SEARCHCOLUMNS');
    brodos.fulltext.Searchpanel.superclass.constructor.call(this, config);
};

brodos.fulltext.Tbrowser = function (config){
    brodos.fulltext.Tbrowser.superclass.constructor.call(this, config);
};

Ext.extend(brodos.fulltext.Tbrowser, brodos.tbrowser.Browser,{
    
    initComponent : function (config)
    {
        this.cssAdditions = '.x-grid3-row-table { cursor:pointer; }';
        this.additionalGridViewConfig = {
                forceFit    : false,
                autoFill    : false,
                emptyText   : '<span class="errortxt">'+ brodos.translation.get("_ERROR_NO_DATA_FOUND")+ '</span>'
        };
       
        this.queryDefinitionKey = "query1";
        this.providerUrl     = brodos.config.get('DSI_URL');
        this.autoLoadStore   = false;
        this.pagingPageSize  = 15;
        this.disableTopToolbar  = true;
        this.isEditable         = false;
        this.disableNewButton   = true;
        this.disableSaveButton  = true;
        this.disableDeleteButton= true;
        this.enableCheckboxSelection= false;
        this.enableSorting      = false;
        this.enableFilters      = false;
        this.enableGrouping     = false;
        brodos.fulltext.Tbrowser.superclass.initComponent.apply(this, arguments);
    },
    setFilters: function (filtersarray){
        this.hardFilters = filtersarray;
    }
});

Ext.extend(brodos.fulltext.Searchpanel, Ext.Panel,{
    //width   : 380,
    autoHeight  : true,
    layout      : 'form',
    border      : false,
    buttonAlign : 'center',
    cls         : 'masktxt',

    initComponent : function (config)
    {
        brodos.fulltext.Searchpanel.superclass.initComponent.apply(this, arguments);

        this.fulltextInputField = new Ext.form.TextField({
            minLength   : 3,
            fieldLabel  : brodos.translation.get('_MASK_FULLTEXTSEARCH'),
            minLengthText: brodos.translation.get('_MASK_MIN_TEXTLENGTH'),
            allowBlank  : true,
            width       : 250,
            anchor      : '-20',
            listeners   : {
                render  : {
                    fn  : function(cmp) {
                        cmp.focus(true,200);
                    }
                }
            }
        });
        this.tb = false;
        this.win = false;
        this.FulltextSearchButton = new Ext.Button({text:brodos.translation.get('ESB_GO')});

        this.FulltextSearchDescriptionLabel = new Ext.form.Label({
            text    : this.descriptionLabel,
            cls     : 'valuetxt',
            style   : 'margin-left:85'
        });

       // this.add(this.fulltextInputField);
        this.add({xtype:'compositefield',autoWidth:true,items:[this.fulltextInputField,this.FulltextSearchButton]});
        this.add(this.FulltextSearchDescriptionLabel);
//        this.addButton(this.FulltextSearchButton);
    }
});
