Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

输入参数freeze: 'E3',从C5开始画的,问题我给解决了,你看看呢 #68

Closed
1369220324 opened this issue Mar 15, 2019 · 3 comments

Comments

@1369220324
Copy link

change:
alphabet.js 文件的第38行,改为 return [parseInt(y, 10) - 1, indexAt(x)];
可以解决问题

@1369220324 1369220324 changed the title 输入参数freeze: 'D3',从C4开始画的,问题我给解决了,你看看呢 输入参数freeze: 'E3',从C5开始画的,问题我给解决了,你看看呢 Mar 15, 2019
@myliang
Copy link
Owner

myliang commented Mar 15, 2019

这个问题早就解决了

@myliang
Copy link
Owner

myliang commented Mar 15, 2019

change:
alphabet.js 文件的第38行,改为 return [parseInt(y, 10) - 1, indexAt(x)];
可以解决问题

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title><%= htmlWebpackPlugin.options.title %></title>
    
</head>
<body onload="load()">
  <div id="x-spreadsheet-demo"></div>
  <script>
    function load(){
      // x.spreadsheet.locale('zh-cn');
      x.spreadsheet('#x-spreadsheet-demo')
        .loadData({
          freeze: 'C3',
          styles: [
            {
              bgcolor: '#f4f5f8',
              textwrap: true,
              color: '#900b09',
              border: {
                top: ['thin', '#0366d6'],
                bottom: ['thin', '#0366d6'],
                right: ['thin', '#0366d6'],
                left: ['thin', '#0366d6'],
              },
            },
          ],
          merges: [
            'C3:D4',
          ],
          rows: {
            1: {
              cells: {
                0: { text: 'testingtesttestetst' },
                2: { text: 'testing' },
              },
            },
            2: {
              cells: {
                0: { text: 'render', style: 0 },
                1: { text: 'Hello' },
                2: { text: 'haha', merge: [1, 1] },
              }
            },
            8: {
              cells: {
                8: { text: 'border test', style: 0 },
              }
            }
          },
        }).change((cdata) => console.log(cdata));
    }
  </script>
</body>
</html>

image

@1369220324
Copy link
Author

.loadData({
freeze: 'E3',
styles: [
{
bgcolor: '#f4f5f8',
textwrap: true,
color: '#900b09',
border: {
top: ['thin', '#0366d6'],
bottom: ['thin', '#0366d6'],
right: ['thin', '#0366d6'],
left: ['thin', '#0366d6'],
},
},
],
merges: [
'C3:D4',
],
rows: {
1: {
cells: {
0: { text: 'testingtesttestetst' },
2: { text: 'testing' },
},
},
2: {
cells: {
0: { text: 'render', style: 0 },
1: { text: 'Hello' },
2: { text: 'haha', merge: [1, 1] },
}
},
8: {
cells: {
8: { text: 'border test', style: 0 },
}
}
},
}).change((cdata) => console.log(cdata));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants