Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement: Add hotid on instance #183

Open
Rex90 opened this issue Sep 13, 2016 · 1 comment
Open

Improvement: Add hotid on instance #183

Rex90 opened this issue Sep 13, 2016 · 1 comment

Comments

@Rex90
Copy link

Rex90 commented Sep 13, 2016

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);
        }
@Rex90
Copy link
Author

Rex90 commented Sep 13, 2016

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;
        }
    };
}]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants