mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
#82 DataTable code and readme improvements
This commit is contained in:
@@ -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>
|
||||
|
@@ -50,6 +50,9 @@ export class DataTableComponent implements OnInit, AfterViewChecked {
|
||||
@Input()
|
||||
multiselect: boolean = false;
|
||||
|
||||
@Input()
|
||||
actions: boolean = false;
|
||||
|
||||
@Output()
|
||||
rowClick: EventEmitter<any> = new EventEmitter();
|
||||
|
||||
|
@@ -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');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user