I'm encountering an issue with populating a table using ng-repeat after a cellTemplate ng-click.
cellTemplate: '<div ng-click="foo()" ng-bind="row.getProperty(col.field)"></div>'
Within this foo method, I am trying to pass results to the HTML page.
$scope.results = $scope.source;
$scope.foo = function(ngClickResult) {
$scope.showNgClick = this.result;
$scope.ngClickResults = ngClickResult;
The definition for $scope.source is provided here.
angular.forEach($scope.items, function (item) {
if(item.fname === enteredValue.firstName ){
arrItem.push({
first: item.fname,
last: item.lname,
address: item.address,
phone: item.phone
});
}
});
$scope.source= arrItem;
HTML
<tr data-ng-repeat="ngClickResult in ngClickResults">
<td>First Name:{{showNgClick.firstName}}</td>
<td>Last Name:{{showNgClick.lastName}}</td>
<td>Address:{{showNgClick.address}}</td>
<td>Phone:{{showNgClick.phone}}</td>
</tr>
I have a feeling that there is something missing in my results/source. What could it be?
Check out this Plunker link
Search for Tim to start the search.
My objective is to populate the table under NG Click Results with the data displayed in NG grid. I aim to display first name, last name, address, and phone under NG Click Results. When clicking on a row, I want to show all the data associated with that selected row in the grid. For example, click on the first row to display its data, then click on the second row to show its respective data, and so on.