Fix: first elem added not working...

This commit is contained in:
Paolo Arena
2019-03-04 18:48:07 +01:00
parent 9803c451f9
commit a63f744869
10 changed files with 76 additions and 44 deletions

View File

@@ -15,6 +15,8 @@ import { Getter, State, Mutation } from 'vuex-class'
import { costanti } from '@src/store/Modules/costanti'
const namespace: string = 'Todos'
import globalroutines from './../../../globalroutines/index'
@Component({
@@ -44,6 +46,7 @@ export default class Todo extends Vue {
public service: any
public actualMaxPosition: number = 15
public scrollable = true
public tmpstrTodos: string = ''
public categoryAtt: string = ''
// public showtype: number = Todos.state.showtype
@@ -502,5 +505,36 @@ export default class Todo extends Vue {
}
getArrTodos() {
let mystr = ''
let mythis = this
mythis.tmpstrTodos = ''
return globalroutines(null, 'readall', 'todos', null)
.then(function (alldata) {
const myrecs = [...alldata]
myrecs.forEach(rec => {
mystr = mystr + rec.descr + rec.completed + '] ['
})
mythis.tmpstrTodos = 'TODOS: ' + mystr
})
}
// setArrTodos() {
//
// let mystr = ''
// let mythis = this
//
// mythis.tmpstrTodos = ''
// return globalroutines(null, 'write', 'todos', this.todos_arr[0])
// .then(function (alldata) {
// mythis.getArrTodos()
// })
// }
//
}