vitalets / checklist-model

AngularJS directive for list of checkboxes
http://vitalets.github.io/checklist-model
MIT License
1.05k stars 206 forks source link

accessing dynamically named Checklist-model #130

Closed bsridhar123 closed 8 years ago

bsridhar123 commented 8 years ago

Hi,

Requirement:

  1. I would need to have a collection of checkboxes as a group for each row in a table.
  2. And based on each checkbox selection, the next column in the table data needs to be loaded.

Design:

  1. I have used checklist-model for each checkbox group. And i have named the checklist model dynamically using rowid as index.
  2. I am invoking ng-change event and reading the checklist model values.

Issue:

  1. when an ng-change action is triggered on the checkbox, i would need to load the next column based on this selection. But I am not able to get the value of the checklistmodel dynamically. checklistmodel_{{rowid}}. Only if i hardcode it i am able to read. like checklistmodel_0.
  2. Before the selected data is updated into checklist model, ng-change is getting invoked.

I have shared what I have done in the url below,

http://plnkr.co/edit/jjH8OnbhSVplPISJif8k?p=preview

Can you please help me on this.

Thanks, Sridhar

DevQueen commented 8 years ago

Have you posted this question on StackOverflow?

beradrian commented 8 years ago

In the posted example I actually see that you're using an array checklistmodel[rowid] instead of checklistmodel_{{rowid}}. That should actually be the way to achieve what you want. Do you still have an issue here?

beradrian commented 8 years ago

I will close this issue. If you still experience it, please reopen.