ngHandsontable
ngHandsontable copied to clipboard
Improvement: Add hotid on instance
Right now when you pass hot-id attribute it doesnt get attached to the core instance of the table. This is really useful to have when there are multiple tables on a sheet. I cant check in code but on my local version of ngHandsontable adding this worked:
if (htSettings.hotId) {
hot.hotId = htSettings.hotId; // add this line 143
hotRegisterer.registerInstance(htSettings.hotId, hot);
}
In the mean time i created this custom directive
app.directive('hotIdAppend',["hotRegisterer",function(hotRegisterer) {
return {
restrict: 'A',
link: function (scope, element, attr){
var hotInstance = hotRegisterer.getInstance(attr.hotId);
hotInstance.hotId = attr.hotId;
}
};
}]);