<commit_before>// @require ModernizrADownload
// @require excel-builder

Ext.define('Densa.grid.PanelController', {
    extend: 'Densa.mvc.ViewController',
    uses: [ 'Ext.window.MessageBox' ],
    autoSync: true,
    autoLoad: false,
    deleteConfirmTitle: 'Delete',
    deleteConfirmText: 'Do you really wish to remove this entry?',
    exportProgressTitle: 'Export',
    exportProgressMsg: 'Exporting rows...',
    excelExportWorksheetName: 'Worksheet',
    postBackUrl: null,

    grid: null,

    _store: null,

    optionalControl: {

        exportCsv: {
            selector: 'button#exportCsvButton',
            listeners: {
                click: 'onCsvExport'
            }
        },

        exportXls: {
            selector: 'button#exportXlsButton',
            listeners: {
                click: 'onXlsExport'
            }
        },

        deleteButton: {
            selector: 'button#deleteButton',
            listeners: {
                click: 'onDeleteClick'
            }
        }

    },

    init: function()
    {
        if (!this.view) Ext.Error.raise('view config is required');
        if (!(this.view instanceof Ext.grid.Panel)) Ext.Error.raise('view config needs to be a Ext.grid.Panel');
        var grid = this.view;

        if (this.getDeleteButton) this.getDeleteButton().disable();
        grid.on('selectionchange', function(model, rows) {
            if (rows[0]) {
                var row = rows[0];
                if (this.getDeleteButton) this.getDeleteButton().enable();
            } else {
                if (this.getDeleteButton) this.getDeleteButton().disable();
            }
        }, this);
        Ext.each(grid.query('> toolbar[dock=top] field'), function(field) {
            field.on('change', function() {<commit_msg>added check for combobox filter field, if this is editable and forceSelection is enabled filter only on select, not on change<commit_after>// @require ModernizrADownload
// @require excel-builder

Ext.define('Densa.grid.PanelController', {
    extend: 'Densa.mvc.ViewController',
    uses: [ 'Ext.window.MessageBox' ],
    autoSync: true,
    autoLoad: false,
    deleteConfirmTitle: 'Delete',
    deleteConfirmText: 'Do you really wish to remove this entry?',
    exportProgressTitle: 'Export',
    exportProgressMsg: 'Exporting rows...',
    excelExportWorksheetName: 'Worksheet',
    postBackUrl: null,

    grid: null,

    _store: null,

    optionalControl: {

        exportCsv: {
            selector: 'button#exportCsvButton',
            listeners: {
                click: 'onCsvExport'
            }
        },

        exportXls: {
            selector: 'button#exportXlsButton',
            listeners: {
                click: 'onXlsExport'
            }
        },

        deleteButton: {
            selector: 'button#deleteButton',
            listeners: {
                click: 'onDeleteClick'
            }
        }

    },

    init: function()
    {
        if (!this.view) Ext.Error.raise('view config is required');
        if (!(this.view instanceof Ext.grid.Panel)) Ext.Error.raise('view config needs to be a Ext.grid.Panel');
        var grid = this.view;

        if (this.getDeleteButton) this.getDeleteButton().disable();
        grid.on('selectionchange', function(model, rows) {
            if (rows[0]) {
                var row = rows[0];
                if (this.getDeleteButton) this.getDeleteButton().enable();
            } else {
                if (this.getDeleteButton) this.getDeleteButton().disable();
            }
        }, this);
        Ext.each(grid.query('> toolbar[dock=top] field'), function(field) {
            var eventName = 'change';
            if (field instanceof Ext.form.field.ComboBox && field.editable === true && field.forceSelection === true) {
                eventName = 'select';
            }

            field.on(eventName, function() {
{'fraction_non_alphanumeric': 0.1234599589322382, 'fraction_numerical': 0.001026694045174538, 'mean_word_length': 1.9930875576036866, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '896363', 'n_tokens_mistral': 1104, 'n_tokens_neox': 1064, 'n_words': 241}