I am trying to use handsontable to build an editor for my user to add data to my database.
I have the following HTML file:
<html>
<head>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/handsontable/0.35.0/handsontable.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/handsontable/0.35.0/handsontable.min.css" rel="stylesheet">
</head>
<body>
<div style='height:100px; width:100px; background-color: black' id='hello'></div>
<script type="text/javascript" src="stuff.js"></script>
</body>
</html>
And stuff.js
let colNames = ['adwords_id', 'status', 'client', 'is_unlimited', 'account_budget',
'remaining_account_budget', 'currency', 'exchange_rate', 'vendor', 'batch',
'vps', 'login', 'password', 'external_comment', 'internal_comment']
hot = new Handsontable(document.getElementById('hello'), {
startRows:8,
startCols: colNames.length,
rowHeaders: true,
colHeaders: colNames,
columns: [
{ allowEmpty: false },
{ type:'dropdown', source: ['active', 'dead'] },
{ type:'dropdown', source: ['bart', 'alex'] },
{ type:'checkbox' },
{ type:'numeric', // TODO undefined "culture"
numericFormat: { pattern: '$0,0.00', culture: 'en-US' },
},
{},
{ type:'dropdown', source: ['usd', 'hkd'] },
{},
{ type:'dropdown', source: ['acme inc', 'hong kong company'] },
{},
{ type:'dropdown', source: ['hk-001', 'hk-002'] },
{},
{},
{},
{},
]
});
Somehow when I try to edit the column for “account_budget”, I am getting the following error:
handsontable.min.js:29 Uncaught TypeError: Cannot read property 'culture' of undefined
at i (handsontable.min.js:29)
at i.setDataAtCell (handsontable.min.js:29)
at Object.populateFromArray (handsontable.min.js:29)
at i.populateFromArray (handsontable.min.js:29)
at t.n.saveValue (handsontable.min.js:29)
at t.n.finishEditing (handsontable.min.js:29)
at n.closeEditor (handsontable.min.js:29)
at n.closeEditorAndSaveChanges (handsontable.min.js:29)
at i.p (handsontable.min.js:29)
at e.value (handsontable.min.js:29)
I turned numeric off and this error is gone.
Any ideas?