Older version of angularjs, 1.3.x, but I'm assuming this should be pretty
similar in functionality in pre Angular 2 days.
So I have n number objects that are rendered into rows of a table.
Each are provided a column that contains a checkbox, the header of which
has a select/deselect all controlling checkbox, so like this:
Header:
<input type="checkbox" ng-model="selectAllLineItems" />
and all <tr><td> entries for this column rendered during the ng-repeat
process looks like:
<input type="checkbox" ng-checked="selectAllLineItems" />
and this works fine, e.g., click on header checkbox to select, all items
rows are selected, click on checkbox to deselect, all others are deselect.
Easy part done.
I need to keep track of how many of these are selected at any given time as
well as the ability to check the ID of the row column, e.g., column 1 is an
invoice number.
So I envision an object that looks something like this: {id: 12345,
selected: false} that is inserted dynamically into a model array in behalf
of each rendered row for the checkbox when initialized, and then modify the
selected member variable upon selecting and deselecting. (as well as
watching when any of the checkboxes are changed so I can keep track of
count).
This sounds relatively basic, but all of the examples I've located for this
assume a fixed list of checkbox items.
Can someone please provide some hints on where I go with this?
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.