UPDATE: It seems that there is some confusion here, I am looking to apply the function to all rows, without using '', "", '"...
After conducting some research, I have discovered that I will need to utilize $compile, but I am unsure of how to implement it in this scenario. Can someone please assist me?
I'm encountering difficulty passing parameters on the second to the last page of a datatable.
All rows should contain a button that triggers a function to open a modal and display all fields, however, only the first page seems to be functioning properly.
Using razor to display table values and send parameters, upon inspecting the other pages I notice that all buttons have the correct value, but they are not triggering the function "GetData()" on those pages.
Below is the code snippet:
<div ng-app="testApp" ng-controller="testController">
<table id="customTable" class="table table-responsive table-hover table-striped table-bordered custom-Datatable" style="font-family:'Segoe UI'; width:100%;">
<thead>
<tr class="bg-primary text-center" style="color:white">
<th>Status</th>
<th>AuthorizationNumber</th>
<th>Remarks</th>
<th>Client</th>
<th>MerchantName</th>
<th>Option</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr style="font-family:'Segoe UI'" class="text-center">
<td>
@Html.DisplayFor(model => item.Status)
</td>
<td>
@Html.DisplayFor(model => item.AuthorizationNumber)
</td>
<td>
@Html.DisplayFor(model => item.Remarks)
</td>
<td>
@Html.DisplayFor(model => item.ClientName)
</td>
<td>
@Html.DisplayFor(model => item.MerchantName)
</td>
<td>
<input type="button" value="See More"
ng-click="GetData('@item.Id')"
class="btn btn-outline-primary" />
</td>
</tr>
}
</tbody>
</table>
</div>
This is my JavaScript code:
var app = angular.module('testApp', []);
app.controller('testController', function ($scope, $http) {
$scope.GetData = function (id) {
$http.post('/WexReportInfoes/GetTransaction', { InfoId: id })
.then(function (result) {
debugger;
if (result.data.error == null) {
$scope.object = result.data;
$('#modalInfo').modal('show');
}
else {
alert('error')
}
})
}
})
Has anyone encountered this issue before and can offer guidance?