Thank you for your quick response !
I do want to update moved items, that’s my problem, nothing is updating.
Here is a practical example :
I load into webix (fManager.load()) this JSON array :
{"id":"Files",
"data":
[{"id":"575fcf10d2fa864417be1a17",
"path":"Documents",
"value":"Documents",
"type":"folder",
"data":
[{"id":"575fcf66d2fa864417be1a19",
"path":"Documents/Test",
"value":"Test",
"type":"folder",
"date":1465896806,
"size":0,
"data":[]},
{"id":"575fd0bfd2fa864417be1a2a",
"path":"Documents/Projets",
"value":"Projets",
"type":"folder",
"date":1465897151,
"size":0,
"data":
[{"id":"575fd26bc8171e1c13e9f074",
"path":"Documents/Projets/zBCJSMb.jpg",
"value":"zBCJSMb.jpg",
"type":"image",
"date":1465897579,
"size":540773},
{"id":"575fd068d2fa864417be1a29",
"path":"Documents/Projets/a.txt",
"value":"a.txt",
"type":"text",
"date":1465897064,
"size":6},
{"id":"575fcff0d2fa864417be1a25",
"path":"Documents/Projets/b.txt",
"value":"b.txt",
"type":"text",
"date":1465896944,
"size":6},
{"id":"575fcf78d2fa864417be1a1d",
"path":"Documents/Projets/c.txt",
"value":"c.txt",
"type":"text",
"date":1465896824,
"size":6},
(...)
{"id":"575fcf93d2fa864417be1a22",
"path":"Documents/i.txt",
"value":"i.txt",
"type":"text",
"date":1465896851,
"size":6},
(...)]}]}
It works perfectly, everything is showned as expected.
Then I try to move. Here is the request (req.body) I get in my move function :
{ action: ‘move’,
source: ‘575fd068d2fa864417be1a29,575fcff0d2fa864417be1a25,575fcf78d2fa864417be1a1d,575fcfbad2fa864417be1a23’,
temp: ‘575fd068d2fa864417be1a29,575fcff0d2fa864417be1a25,575fcf78d2fa864417be1a1d,575fcfbad2fa864417be1a23’,
target: ‘575fcf66d2fa864417be1a19’ }
I process this, move the files in my database accordingly, everything works fine. Then I send this response (which is wrong obviously) :
[ { id: '575fd068d2fa864417be1a29',
value: 'a.txt',
type: 'text',
date: 1465897064,
size: 6 },
{ id: '575fcfbad2fa864417be1a23',
value: 'j.txt',
type: 'text',
date: 1465896890,
size: 6 },
{ id: '575fcff0d2fa864417be1a25',
value: 'b.txt',
type: 'text',
date: 1465896944,
size: 6 },
{ id: '575fcf78d2fa864417be1a1d',
value: 'c.txt',
type: 'text',
date: 1465896824,
size: 6 } ]
And nothing changes.
I tried with [{id: “id”, value: “value”},…] as you suggested, but it does nothing.
I get what you’re saying, but my Ids dont change, nor does the value, since the file just change parents.
Should I change my whole array mapping process so the ids are set to the path to each objects ? I’m a little bit confused…
Thank you very much for your time.
PS: sorry for the formatting, I hope it’s clear enough… tell me if you need any other information.