Permalink
Browse files

#1228. Added more descriptive error message, when trying to insert ne…

…w column to a table with object datasource.
  • Loading branch information...
1 parent 7e19a3a commit 646794c2eb50d93f11a22cee1460e04f76b9a7cd @psmolenski psmolenski committed Jan 2, 2014
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/core.js
View
4 src/core.js
@@ -202,7 +202,9 @@ Handsontable.Core = function (rootElement, userSettings) {
*/
createCol: function (index, amount) {
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()
, data = GridSettings.prototype.data

0 comments on commit 646794c

Please sign in to comment.