# HG changeset patch # User casties # Date 1453897838 -3600 # Node ID 991bf349bb048dded0770078b4775f16e8a1efd2 # Parent 0795207f3b904c3270a37c9235fe29079b061e29 re-display table more often. diff -r 0795207f3b90 -r 991bf349bb04 app/query-app.component.ts --- a/app/query-app.component.ts Tue Jan 26 19:19:23 2016 +0100 +++ b/app/query-app.component.ts Wed Jan 27 13:30:38 2016 +0100 @@ -16,6 +16,8 @@ template: `

ISMI-Lab Query Builder

+
+
Select a query step:
add step
+ +
diff -r 0795207f3b90 -r 991bf349bb04 app/query-result-table.component.ts --- a/app/query-result-table.component.ts Tue Jan 26 19:19:23 2016 +0100 +++ b/app/query-result-table.component.ts Wed Jan 27 13:30:38 2016 +0100 @@ -9,6 +9,7 @@ selector: 'query-result-table', template: `
+ Cypher query:
{{queryState.resultCypherQuery}}

Query result

{{queryState.resultInfo}}: page {{page}} of {{numPages}}
@@ -56,13 +57,10 @@ ngOnChanges() { console.debug("result table changed! queryState=", this.queryState?this.queryState.resultColumns:''); this.config.sorting = this.queryState.resultColumns; + this.onChangeTable(this.config, null); } ngOnInit() { - this.setup(); - } - - setup() { console.debug("result table init!"); } @@ -73,19 +71,16 @@ } changeSort(data: any, config: any) { + console.debug("changeSort start"); if (!config.sorting) { return data; } let columns = this.columns.filter(c => c.sort); - // simple sorting - return data.sort((previous: any, current: any) => { - //let columns = this.config.sorting.columns || []; + let sorted = data.sort((previous: any, current: any) => { for (let i = 0; i < columns.length; i++) { let sort = columns[i].sort; - if (!sort) continue; let columnName = columns[i].name; - if (previous[columnName] > current[columnName]) { return sort === 'desc' ? -1 : 1; } else if (previous[columnName] < current[columnName]) { @@ -94,6 +89,8 @@ } return 0; }); + console.debug("changeSort done"); + return sorted; } changeFilter(data: any, config: any): any { @@ -108,7 +105,7 @@ } onChangeTable(config, page: any = config.paging) { - //console.debug("onChangeTable config=", config); + console.debug("onChangeTable config=", config); if (config.filtering) { Object.assign(this.config.filtering, config.filtering); } diff -r 0795207f3b90 -r 991bf349bb04 package.json --- a/package.json Tue Jan 26 19:19:23 2016 +0100 +++ b/package.json Wed Jan 27 13:30:38 2016 +0100 @@ -16,7 +16,7 @@ "zone.js": "npm:zone.js@^0.5.10" }, "devDependencies": { - "typescript": "npm:typescript@^1.6.2" + "typescript": "npm:typescript@^1.7.3" } }, "dependencies": {},