<commit_before><div class="content">
    <div id="example_title">
        <h1>Events</h1>
        Last event is shown in preview. Log of events is available in console.
    </div>
    <div id="example_view"></div>
    <div id="example_code"></div>
</div>

<!--CODE-->
<div id="grid" style="width: 100%; height: 350px;"></div>
<br><br>
<b>Preview</b>
<div id="preview"></div>

<!--CODE-->
<script>
$(function () {
    $('#grid').w2grid({
        name: 'grid',
        header: 'List of Names',
        url: 'data/list.json',
        method: 'GET', // need this to avoid 412 error on Safari
        show: {
            header         : true,
            toolbar     : true,
            footer        : true,
            lineNumbers    : true,
            selectColumn: true,
            expandColumn: true
        },
        columns: [
            { field: 'fname', text: 'First Name', size: '150px', info: true },
            { field: 'lname', text: 'Last Name', size: '150px' },
            { field: 'email', text: 'Email', size: '200px' },
            { field: 'sdate', text: 'Start Date', size: '200px' }
        ],
        searches: [
            { type: 'int',  field: 'recid', label: 'ID' },
            { type: 'text', field: 'fname', label: 'First Name' },
            { type: 'text', field: 'lname', label: 'Last Name' },
            { type: 'date', field: 'sdate', label: 'Start Date' }
        ],
        onExpand: function (event) {
            $('#'+event.box_id).html('<div style="padding: 10px; height: 100px">Expanded content</div>');
        }
    });
    // attach event listener for all events
    w2ui.grid.on('*', function (event) {
        let edata = $.extend({}, event)
        if (edata.originalEvent) edata.originalEvent = {'...':'...'}
        if (edata.error) edata.error = {'...':'...'}
        if (edata.errors) edata.errors = {'...':'...'}
        if (edata.xhr) edata.xhr = {'...':'...'}
        $('#preview').html(`Event: ${event.type}<pre style="font-size: 12px; line-height: 1.4">${JSON.stringify(edata, null, 2)}</pre>`);
        console.log('Event: '+ event.type, 'Target: '+ event.target, event);
    });
});
</script><commit_msg>Fixed #2250<commit_after><div class="content">
    <div id="example_title">
        <h1>Events</h1>
        Last event is shown in the preview. Log of events is available in the console.
    </div>
    <div id="example_view"></div>
    <div id="example_code"></div>
</div>

<!--CODE-->
<div id="grid" style="width: 100%; height: 350px;"></div>
<br><br>
<b>Preview</b>
<div id="preview"></div>

<!--CODE-->
<script>
query(() => {
    new w2grid({
        name: 'grid',
        box: query('#grid')[0],
        header: 'List of Names',
        url: 'data/list.json',
        method: 'GET', // need this to avoid 412 error on Safari
        show: {
            header         : true,
            toolbar     : true,
            footer        : true,
            lineNumbers    : true,
            selectColumn: true,
            expandColumn: true
        },
        columns: [
            { field: 'fname', text: '<NAME>', size: '150px', info: true },
            { field: 'lname', text: '<NAME>', size: '150px' },
            { field: 'email', text: 'Email', size: '200px' },
            { field: 'sdate', text: 'Start Date', size: '200px' }
        ],
        searches: [
            { type: 'int',  field: 'recid', label: 'ID' },
            { type: 'text', field: 'fname', label: '<NAME>' },
            { type: 'text', field: 'lname', label: '<NAME>' },
            { type: 'date', field: 'sdate', label: 'Start Date' }
        ],
        onExpand(event) {
            query('#'+event.box_id).html('<div style="padding: 10px; height: 100px">Expanded content</div>');
        }
    });
    // attach event listener for all events
    w2ui.grid.on('*', (event) => {
        let edata = w2utils.extend({}, event.detail)
        query('#preview').html(`
            Event: ${event.type}
            <pre style="font-size: 12px; line-height: 1.4">${JSON.stringify(edata, null, 2)}</pre>
        `);
        console.log('Event: '+ event.type, 'Target: '+ event.target, event);
    });
});
</script>
{'fraction_non_alphanumeric': 0.20120192307692308, 'fraction_numerical': 0.01826923076923077, 'mean_word_length': 2.037226277372263, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 61, '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': '7219272', 'n_tokens_mistral': 1386, 'n_tokens_neox': 1319, 'n_words': 340}