ng2-table
ng2-table copied to clipboard
Default sorting
Hi! When I add { ..., 'sort'='asc', ...} to any of my columns (default sorting), the column doesn't get sorted, its values are all random. The demo itself - http://valor-software.com/ng2-table/ is not working. Look at the Office column - ...name: 'office', sort: 'asc'}. Is this a bug or what?
Ok, I figure it out. You have bug in your example on this line
if (columns[i].sort !== '' && columns[i].sort !== false) {
This condition is incomplete, because the way it is now, columns without sort property will fulfill the condition. The line should be like this:
if (columns[i].sort !== '' && columns[i].sort !== false && columns[i].sort !== undefined) {