Numeric type fails - "culture" is undefined?

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?

Hi @vincent

Can you upload the editor into this Fiddle http://jsfiddle.net/rLtqtbnh/?

Dear Aleksandra,

Your code works. Strange enough, when I change it to the script to https://cdnjs.cloudflare.com/ajax/libs/handsontable/0.35.0/handsontable.min.js I am getting the error ‘Cannot read property ‘culture’ of undefined’

Please see Handsontable example - JSFiddle - Code Playground

Is this a bug? or am I supposed to be importing languages.min.js as well?

In your example, you downloaded the .js file from the CE version but languages and CSS from the PRO version.

Please see http://jsfiddle.net/rLtqtbnh/2/

OK. The cell type numeric has to use the full version of the resources (handsontable.full.min.js) as it loads Numbro and culture is a part of it (line 25 in your example). The languages file is a part of Numbro languages coding (also line 25 en_US)

Thank you that solves it!

Great! Thanks for an update.
I guess that we can close the issue.