<commit_before>Ext.define('devilry.gradeeditors.GradeEditorSelector', {
    extend: 'Ext.form.field.ComboBox',
    alias: 'widget.gradeeditorselector',
    cls: 'widget-gradeeditorselector',
    requires: ['devilry.gradeeditors.GradeEditorModel'],

    valueField: 'gradeeditorid',
    displayField: 'title',
    queryMode: 'local',

    listConfig: {
        getInnerTpl: function() {
            return '<div class="important">{title}</div><div class="unimportant">{description}</div>';
        }
    },


    initComponent: function() {
        this.loadingFinished = false;
        this.store = Ext.create('Ext.data.Store', {
            model: 'devilry.gradeeditors.GradeEditorModel',
            autoSync: true
        });
        this.addListener('render', function() {
            if(!this.loadingFinished) {
                this.getEl().mask('Loading');
            }
        }, this);
        this.callParent(arguments);
        this.store.load({
            scope: this,
            callback: function(records, op, success) {
                if(success) {
                    this.onLoadSuccess(records);
                } else {
                    this.onLoadFailure(records);
                }
            }
        });
    },

    onLoadSuccess: function(records) {
        this.setValue(this.value);
        this.loadingFinished = true;
        if(this.rendered) {
            this.getEl().unmask();
        }
    },

    onLoadFailure: function() {
        console.error('Failed to load records');
    }
});
<commit_msg>apps.gradeeditors: GradeEditorSelector uneditable.<commit_after>Ext.define('devilry.gradeeditors.GradeEditorSelector', {
    extend: 'Ext.form.field.ComboBox',
    alias: 'widget.gradeeditorselector',
    cls: 'widget-gradeeditorselector',
    requires: ['devilry.gradeeditors.GradeEditorModel'],

    valueField: 'gradeeditorid',
    displayField: 'title',
    queryMode: 'local',
    editable: false,

    listConfig: {
        getInnerTpl: function() {
            return '<div class="important">{title}</div><div class="unimportant">{description}</div>';
        }
    },


    initComponent: function() {
        this.loadingFinished = false;
        this.store = Ext.create('Ext.data.Store', {
            model: 'devilry.gradeeditors.GradeEditorModel',
            autoSync: true
        });
        this.addListener('render', function() {
            if(!this.loadingFinished) {
                this.getEl().mask('Loading');
            }
        }, this);
        this.callParent(arguments);
        this.store.load({
            scope: this,
            callback: function(records, op, success) {
                if(success) {
                    this.onLoadSuccess(records);
                } else {
                    this.onLoadFailure(records);
                }
            }
        });
    },

    onLoadSuccess: function(records) {
        this.setValue(this.value);
        this.loadingFinished = true;
        if(this.rendered) {
            this.getEl().unmask();
        }
    },

    onLoadFailure: function() {
        console.error('Failed to load records');
    }
});

{'fraction_non_alphanumeric': 0.13569604086845466, 'fraction_numerical': 0.0, 'mean_word_length': 1.9528746465598492, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '20786', 'n_tokens_mistral': 883, 'n_tokens_neox': 852, 'n_words': 128}