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

Problem building the treetable dynamically with an angular directive #194

Open
dgodwin1175 opened this issue Jan 10, 2017 · 0 comments
Open

Comments

@dgodwin1175
Copy link

dgodwin1175 commented Jan 10, 2017

Hi,
Not sure if anyone has had any experience working with this component in angular?
I'm building up the rows of the table dynamically inside an angular directive, which works great. The trouble I have is handling the ng-click events on links in the rows, where those ng-click attributes point to functions in my controller.

E.g. the HTML looks like this (excuse the lack of angle brackets, they don't appear to be allowed):
table ch-tree-table class="treeTable" ng-model="myCtrl.myData" ng-expandable="true"
thead
tbody/
/table

My directive is doing this sort of thing:
var node = $(elements).treetable("node", i + 1);
var html = "tr class='rowHeader' data-tt-branch='true' data-tt-id='1'" +
"td" +
"a href='#' ng-click='myCtrl.clickHandler()'>Click me /a" +
"/td" +
"/tr";
var locationLinkFn = this.$compile(html);
var content = locationLinkFn(scope);
$(elements).treetable("loadBranch", node, content);

While the table renders as expected, clicking on the 'Click me' link does not call my clickHander() function.

Any suggestions on how to achieve this?
Thanks.

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

No branches or pull requests

1 participant