diff app/query.service.ts @ 25:0795207f3b90

ng2-table now with pager, sorting and styling.
author casties
date Tue, 26 Jan 2016 19:19:23 +0100
parents f6f4177d0a81
children 193271b6b9d2
line wrap: on
line diff
--- a/app/query.service.ts	Tue Jan 26 16:54:38 2016 +0100
+++ b/app/query.service.ts	Tue Jan 26 19:19:23 2016 +0100
@@ -7,6 +7,7 @@
 import {QueryMode, QUERY_MODES} from './query-mode';
 import {QueryState} from './query-state';
 import {QueryStep} from './query-step';
+import {ResultColumn} from './result-column';
 
 @Injectable()
 export class QueryService {
@@ -280,14 +281,14 @@
     getColumns(attributes: string[]) {
         var cols = [];
         if (attributes.indexOf('ismi_id') > -1) {
-            cols.push({'name': 'ismi_id', 'title': 'ISMI ID'});
+            cols.push(new ResultColumn('ismi_id', 'ISMI ID'));
         }
         if (attributes.indexOf('label') > -1) {
-            cols.push({'name': 'label', 'title': 'Label'});
+            cols.push(new ResultColumn('label', 'Label', 'asc'));
         }
         attributes.forEach((att) => {
             if (att != 'ismi_id' && att != 'label' && att != 'type' && att[0] != '_') {
-                cols.push({'name': att, 'title': att});
+                cols.push(new ResultColumn(att, att));
             }
         });