I'm working on a system that requires paging of data, but first I'd like to sort the json I get in the order of user names.
JSON is in the format:
[["22","Aiolinhos","23","[email protected]","Administradores","SIM"],["20","Aiorinhos","21","[email protected]","Administradores","SIM"],["6","Aldebas","7","[email protected]","Administradores","SIM"],["12","Caminhus","13","[email protected]","Administradores","SIM"],["18","Ditinho","19","[email protected]","Administradores","SIM"],["3","Dohkinho","3","[email protected]","Administradores","SIM"],["8","Kanonzinho","9","[email protected]","Administradores","SIM"],["14","Milinho","15","[email protected]","Administradores","SIM"],["4","Muzinho","4","[email protected]","Administradores","SIM"],["2","Saguinha","2","[email protected]","Administradores","SIM"],["1","Shakinha","1","[email protected]","Administradores","SIM"],["16","Shionzinho","17","[email protected]","Administradores","SIM"],["10","Shurinha","11","[email protected]","Administradores","SIM"]]
And the html + angular snippets I created to show this data to the user are:
<div class="container">
<div class="jumbotron">
<div class="row">
<div class="col-xs-12 text-right">
<button type="button" class="btn btn-secondary" ng-click="create()">Novo</button>
</div>
</div>
<table class="table table-hover">
<thead>
<tr>
<td ng-repeat="header in headers track by $index">{{header}}</td>
<td ng-if="headers.length">Editar / Remover</td>
</tr>
</thead>
<tr ng-repeat="row in rows | orderBy:order track by $index">
<td ng-repeat="cell in row track by $index" ng-if="!$first">{{cell}}</td>
<td ng-if="row.length"><button type="button" class="btn btn-secondary glyphicon glyphicon-pencil" ng-click="edit(row)"></button>
<button type="button" class="btn btn-danger glyphicon glyphicon-trash" ng-click="delete(row)"></button></td>
</tr>
</table>
</div>
</div>
controller:function($scope,$routeParams,$location,crudservice){
$scope.headers = [];
$scope.rows = [[]];
$scope.modelPath = $routeParams.model;
$scope.order = 0;
crudservice.model = {};
crudservice.listModel($routeParams.model).then(function(response){
if(response.data.status == 1){
var data = response.data;
console.log(JSON.parse(data.headers));
console.log(JSON.parse(data.rows));
$scope.headers = JSON.parse(data.headers);
$scope.rows = JSON.parse(data.rows);
}
});
But the table does not show some lines other than the Name, Email, Group, Assets, and Edit / Remove cells in places that should not:
Any assumption of why this is happening?