I am using ng2-smart table with angular 6. When I debug the code, I can see, the order of data in my LocalDataSource in ng2-smart table. But in the table view, it doesn't show the data as the order it was in LocalDataSource. It seams like it has been sorted randomly. Anyone face the same issue or any idea on how to fix this?
Here is my code
this.departmentService.getAllDepartmentDetails().subscribe(response => {
let result = {};
result = response;
this.allDepartments = Object.assign(result);
this.source = new LocalDataSource(this.allDepartments);
this.settings = {
columns: {
id: {
title: 'ID'
},
name: {
title: 'Department Name'
},
reviewerName: {
title: 'Reviewer Name'
}
},
mode: 'external',
actions: {
columnTitle: 'Action',
add: false,
delete: false,
edit:false,
position: 'right',
width: '200px'
},
pager: {
display: true,
perPage: 5
},
attr: {
class: 'table table-striped'
}
};
}, error => {
console.log('FAILED TO LOAD ALL USERS');
console.log(error);
}
);
}
Thanks