Hello I am creating one application using angularjs and ASP.NET MVC with datatable js.
I have implemented table showing data using datatable with angular js by help of this article.
But I want to bind the data using same functionality with column names statically in html like:
In article author has done work using:
<table id="entry-grid" datatable="" dt-options="dtOptions"
dt-columns="dtColumns" class="table table-hover">
</table>
but I want to do it like this by using above same functionality using ng-repeat as per my data:
<table id="tblusers" class="table table-bordered table-striped table-condensed datatable">
<thead>
<tr>
<th width="2%"></th>
<th>User Name</th>
<th>Email</th>
<th>LoginID</th>
<th>Location Name</th>
<th>Role</th>
<th width="7%" class="center-text">Active</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="user in Users">
<td><a href="#" ng-click="DeleteUser(user)"><span class="icon-trash"></span></a></td>
<td><a class="ahyperlink" href="#" ng-click="EditUser(user)">{{user.UserFirstName}} {{user.UserLastName}}</a></td>
<td>{{user.UserEmail}}</td>
<td>{{user.LoginID}}</td>
<td>{{user.LocationName}}</td>
<td>{{user.RoleName}}</td>
<td class="center-text" ng-if="user.IsActive == true"><span class="icon-check2"></span></td>
<td class="center-text" ng-if="user.IsActive == false"><span class="icon-close"></span></td>
</tr>
</tbody>
</table>
I also want to add new column inside the table using the same functionality on button click Add New Record.
Is it possible?
If yes how it can be possible it will be nice and thanks in advance if anyone show me in jsfiddle or any editor.
Please DOWNLOAD source code created in Visual Studio Editor for demo