Skip to content

Commit

Permalink
#1228. Added more descriptive error message, when trying to insert ne…
Browse files Browse the repository at this point in the history
…w column to a table with object datasource.
  • Loading branch information
psmolenski committed Jan 2, 2014
1 parent 7e19a3a commit 646794c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ Handsontable.Core = function (rootElement, userSettings) {
*/ */
createCol: function (index, amount) { createCol: function (index, amount) {
if (priv.dataType === 'object' || priv.settings.columns) { if (priv.dataType === 'object' || priv.settings.columns) {
throw new Error("Cannot create new column. When data source in an object, you can only have as much columns as defined in first data row, data schema or in the 'columns' setting"); throw new Error("Cannot create new column. When data source in an object, " +
"you can only have as much columns as defined in first data row, data schema or in the 'columns' setting." +
"If you want to be able to add new columns, you have to use array datasource.");
} }
var rlen = instance.countRows() var rlen = instance.countRows()
, data = GridSettings.prototype.data , data = GridSettings.prototype.data
Expand Down

0 comments on commit 646794c

Please sign in to comment.