Hi everybody,
I am not sure how to approach this problem, so I'm looking for ideas. I have a table with 4 fixed columns and about 15 more columns which are boolean. I would like to be able to generate html table using names of the columns and automatically create checkboxes in these columns with correct ng-model. I am not sure how to express this.
Here is what I have so far:
<table id="searchTable" ng-show="results.length>0"
class="table table-responsive table-hover table-list"
style="width:800px;">
<thead search-table-header table="table" search="search()">
</thead>
<tbody>
<tr ng-repeat="result in results">
<td>
{{ result.salespoint }}
</td>
<td>
{{ result.id }}
</td>
<td>
{{ result.description }}
</td>
<td>
<select class="form-control" ng-model="result.mode"
ng-options="s.modeId as s.description for s in metaData.salespointModes">
</select>
</td>
</tr>
</tbody>
</table>
for these 4 columns I know names of. I don't know how to write the code for the rest of the columns in the result object.
Also, ideally, the first 4 columns should always be visible on the page (locked) and I should be able to scroll to the rest of the columns.
There are more requirements for these extra columns (say, the order of these columns will be based on does the client have valid licenses for that type or not), but for now I'm just trying to figure out how to generate these columns on the page and bind properly.
Thanks in advance.
If it's not broken, fix it until it is.
My Blog