jspreadsheet / pro

Jspreadsheet Pro | The javascript spreadsheet
https://jspreadsheet.com/
15 stars 1 forks source link

Error setting Nested Headers #313

Closed JohnPatrickOshaughnessy closed 8 months ago

JohnPatrickOshaughnessy commented 9 months ago

This issue started this morning after linking to the latest version of jspreadsheet Pro. When I use sheet.setNestedHeaders I get the following error:

TypeError: undefined is not an object (evaluating 'this[a(643)][a(1220)]')

Screenshot

image

I am able to replicate it using a slightly customized example code from https://jspreadsheet.com/docs/nested-headers.

Until aboout 18:00 GMT last night things were working fine then this happened this morning, perhaps there has been an update?

Here is the sample code:

<html>
<script src="https://jspreadsheet.com/v10/jspreadsheet.js"></script>
<script src="https://jsuites.net/v5/jsuites.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v5/jsuites.css" type="text/css" />
<link rel="stylesheet" href="https://jspreadsheet.com/v10/jspreadsheet.css" type="text/css" />

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />

<div id="spreadsheet"></div>

<input type='button' value='Update'
    onclick="table[0].setNestedCell(0, 0, { title:'New title',tooltip:'New tooltip' })">

<script>
// Set your JSS license key (The following key only works for one day)
jspreadsheet.setLicense('OTVlMDg0ZTM0YTA1YWZkMTU4Y2MyM2IwN2NmMDhkZmVhNjQxMTliMDg4NTIxNDE3YjYyYWEwZDk0MmI5MGE1ZmYxNTQwZmZmMjMzZGNjMjA2ZGU4NjQ1MmJhYmM4ZTY0NjgzZTk2ZTc5M2JmZDAzMTRlOGNlYWM2Mjc2MmNlZjYsZXlKdVlXMWxJam9pU25Od2NtVmhaSE5vWldWMElpd2laR0YwWlNJNk1UY3dOalk1TmpVME1Td2laRzl0WVdsdUlqcGJJbXB6Y0hKbFlXUnphR1ZsZEM1amIyMGlMQ0pqYjJSbGMyRnVaR0p2ZUM1cGJ5SXNJbXB6YUdWc2JDNXVaWFFpTENKamMySXVZWEJ3SWl3aWQyVmlJaXdpYkc5allXeG9iM04wSWwwc0luQnNZVzRpT2lJek5DSXNJbk5qYjNCbElqcGJJblkzSWl3aWRqZ2lMQ0oyT1NJc0luWXhNQ0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklsMHNJbVJsYlc4aU9uUnlkV1Y5');

// Create the spreadsheet
var table = table = jspreadsheet(document.getElementById('spreadsheet'), {
    worksheets: [{
        data: [
            ['BR', 'Cheese', 1],
            ['CA', 'Apples', 0],
            ['US', 'Carrots', 1],
            ['GB', 'Oranges', 0],
        ],
        columns: [
            {
                type: 'autocomplete',
                title: 'Country',
                width: '200px',
                url: '/jspreadsheet/countries'
            },
            {
                type: 'dropdown',
                title: 'Food',
                width: '100px',
                source: ['Apples','Bananas','Carrots','Oranges','Cheese']
            },
            {
                type: 'checkbox',
                title: 'Stock',
                width: '100px'
            },
            {
                type: 'number',
                title: 'Price',
                width: '100px'
            },
        ],
        minDimensions: [8,4]
    }]
});

jspreadsheet.spreadsheet[0].worksheets[0].setNestedHeaders([
            [
                {
                    title: 'Supermarket information',
                    colspan: '8',
                },
            ],
            [
                {
                    title: 'Location',
                    colspan: '1',
                },
                {
                    title: ' Other Information',
                    colspan: '2'
                },
                {
                    title: ' Costs',
                    colspan: '5'
                }
            ],
        ])
</script>
</html>
JohnPatrickOshaughnessy commented 9 months ago

Hello, Any update on this? I'm still getting the nested headers issue with the latest code.

hodeware commented 8 months ago

That is already published on the NPM.

JohnPatrickOshaughnessy commented 8 months ago

Hi there,

I’m not sure what you mean by “That is already published on the NPM” I am still getting the same error using the sample code I posted in the issue and this is stopping me from using the latest jspreadsheet library.

Am I doing something wrong in the sample code or is there a more recent library I need to use?

John

On 11 Feb 2024, at 16:15, HW @.***> wrote:

That is already published on the NPM.

— Reply to this email directly, view it on GitHub https://github.com/jspreadsheet/pro/issues/313#issuecomment-1937797965, or unsubscribe https://github.com/notifications/unsubscribe-auth/BC2BNWR2OA5BVPBHVN7ONVDYTDVBTAVCNFSM6AAAAABCQ73G4KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZXG44TOOJWGU. You are receiving this because you authored the thread.

hodeware commented 8 months ago

Here is a working example. https://jsfiddle.net/fgu42a9y/7/

JohnPatrickOshaughnessy commented 8 months ago

Ok thanks for that,

I can see that the Fiddle works. By experimenting I can see that the code that is causing the problem is ' url: '/jspreadsheet/countries’

in the first column definition, with that line the error occurs, removing it stops the error. This should work fine for my case but it does seem strange that the example column config at https://jspreadsheet.com/docs/nested-headers contains the problem line.

John

On 14 Feb 2024, at 19:37, HW @.***> wrote:

Here is a working example. https://jsfiddle.net/fgu42a9y/7/

— Reply to this email directly, view it on GitHub https://github.com/jspreadsheet/pro/issues/313#issuecomment-1944468633, or unsubscribe https://github.com/notifications/unsubscribe-auth/BC2BNWRFS6ACOCPLGTQP6NTYTUG6DAVCNFSM6AAAAABCQ73G4KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBUGQ3DQNRTGM. You are receiving this because you authored the thread.