You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was including your directive in another directive and saw that the table didn't get populated with data. After some analysis we concluded that it was due to scope.$parent was not available so we change a bit your code to:
if (!scope.htSettings) {
scope.htSettings = {};
}
var watchDataRows = scope.$watchCollection('datarows', function () {
scope.htSettings['data'] = scope.datarows;
scope.hotInstance = settingFactory.initializeHandsontable(element, scope.htSettings);
if (scope.htSettings.columns) {
for (var i = 0, length = scope.htSettings.columns.length; i < length; i++) {
if (scope.htSettings.columns[i].type == 'autocomplete') {
if (typeof scope.htSettings.columns[i].optionList === 'string') {
var optionList = {};
var match = scope.htSettings.columns[i].optionList.match(/^\s*(.+)\s+in\s+(.*)\s*$/);
if (match) {
optionList.property = match[1];
optionList.object = match[2];
} else {
optionList.object = optionList;
}
scope.htSettings.columns[i].optionList = optionList;
}
autoCompleteFactory.parseAutoComplete(scope.hotInstance, scope.htSettings.columns[i], scope.datarows, true);
}
}
scope.hotInstance.updateSettings(scope.htSettings);
}
});
angular.extend(scope.htSettings, settingFactory.setHandsontableSettingsFromScope(htOptions, scope));
scope.htSettings.afterChange = function () {
if (!$rootScope.$$phase) {
scope.$apply();
}
};
scope.$on('$destroy', function () {
watchDataRows();
});
The text was updated successfully, but these errors were encountered:
Hi,
I was including your directive in another directive and saw that the table didn't get populated with data. After some analysis we concluded that it was due to scope.$parent was not available so we change a bit your code to:
if (!scope.htSettings) {
scope.htSettings = {};
}
var watchDataRows = scope.$watchCollection('datarows', function () {
scope.htSettings['data'] = scope.datarows;
scope.hotInstance = settingFactory.initializeHandsontable(element, scope.htSettings);
if (scope.htSettings.columns) {
for (var i = 0, length = scope.htSettings.columns.length; i < length; i++) {
The text was updated successfully, but these errors were encountered: