<commit_before>Ext.namespace('Vpc.Abstract.List');
Vpc.Abstract.List.Panel = Ext.extend(Ext.Panel,
{
    initComponent: function()
    {
        this.grid = new Vps.Auto.GridPanel({
            controllerUrl: this.controllerUrl,
            baseParams: this.baseParams,
            width: 300,
            split: true,
            region: 'west'
        });

        var cls = eval(this.childConfig['class']);
        this.childPanel = new cls({
            controllerUrl: this.childConfig.config.controllerUrl,
            region: 'center',
            disabled: true
        });

        this.childPanel.on('datachange', function(i) {
            this.grid.reload();
        }, this);

        this.grid.on('deleterow', function() {
            this.grid.getGrid().getSelectionModel().selectPrevious();
        }, this);

        this.grid.on('rowselect', function(model, rowIndex, selected) {
            var params = {
                component_id : this.baseParams.component_id + '-' + selected.data.id
            };
            this.childPanel.load(params);
            this.childPanel.enable();
        }, this);

        this.grid.onAdd = this.onAdd;
        this.layout = 'border';
        this.items = [this.grid, this.childPanel];
        Vpc.Abstract.List.Panel.superclass.initComponent.call(this);
    },

    onAdd : function()
    {
        Ext.Ajax.request({
            mask: true,
            url: this.controllerUrl + '/jsonInsert',
            params: this.baseParams,
            success: function(response, options, r) {
                this.getSelectionModel().clearSelections();
                this.reload({
                    callback: function(o, r, s) {
                        this.getSelectionModel().selectLastRow();
                    },
                    scope: this
                });
            },
            scope: this
        });
    }

});<commit_msg>bindings verwenden<commit_after>Ext.namespace('Vpc.Abstract.List');
Vpc.Abstract.List.Panel = Ext.extend(Ext.Panel,
{
    initComponent: function()
    {
        var cls = eval(this.childConfig['class']);
        this.childPanel = new cls({
            controllerUrl: this.childConfig.config.controllerUrl,
            region: 'center',
            disabled: true
        });

        this.grid = new Vps.Auto.GridPanel({
            controllerUrl: this.controllerUrl,
            baseParams: this.baseParams,
            width: 300,
            split: true,
            region: 'west',
            bindings: [ this.childPanel ]
        });

        this.grid.onAdd = this.onAdd;
        this.layout = 'border';
        this.items = [this.grid, this.childPanel];
        Vpc.Abstract.List.Panel.superclass.initComponent.call(this);
    },

    onAdd : function()
    {
        Ext.Ajax.request({
            mask: true,
            url: this.controllerUrl + '/jsonInsert',
            params: this.getBaseParams(),
            success: function(response, options, r) {
                this.getSelectionModel().clearSelections();
                this.reload({
                    callback: function(o, r, s) {
                        this.getSelectionModel().selectLastRow();
                    },
                    scope: this
                });
            },
            scope: this
        });
    }

});
{'fraction_non_alphanumeric': 0.12692656391659113, 'fraction_numerical': 0.001813236627379873, 'mean_word_length': 1.5540123456790123, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1329327', 'n_tokens_mistral': 902, 'n_tokens_neox': 874, 'n_words': 149}