#82 DataTable code and readme improvements

This commit is contained in:
Denys Vuika
2016-06-01 18:14:54 +01:00
parent 9cf0ce5292
commit e33db9e36f
6 changed files with 61 additions and 6 deletions

View File

@@ -23,7 +23,7 @@
<span *ngIf="col.title">{{col.title}}</span>
</th>
<!-- Actions -->
<th>
<th *ngIf="actions">
<span class="sr-only">Actions</span>
</th>
</tr>
@@ -56,7 +56,7 @@
</td>
<td><!-- todo: actions --></td>
<td *ngIf="actions"><!-- todo: actions --></td>
</tr>
</tbody>

View File

@@ -50,6 +50,9 @@ export class DataTableComponent implements OnInit, AfterViewChecked {
@Input()
multiselect: boolean = false;
@Input()
actions: boolean = false;
@Output()
rowClick: EventEmitter<any> = new EventEmitter();

View File

@@ -39,9 +39,14 @@ export class ObjectDataTableAdapter implements DataTableAdapter {
return new ObjectDataRow(item);
});
this._columns = schema.map(item => {
return new ObjectDataColumn(item);
});
if (schema && schema.length > 0) {
this._columns = schema.map(item => {
return new ObjectDataColumn(item);
});
this.sort(this._columns[0].key, 'asc');
}
}
}