我有以下数组:
packages Array (@24ff99c1)
[99767] Array (@24ff9809)
forceUpload false
length 0
name "testdocument.indd"
packageId "99767"
progressStatus "allowed"
singleItemSize 50582294 [0x303d316]
singleItemUploadedSoFar 17296352 [0x107ebe0]
sortIndex 1338984578952 [0x137c1b33f88]
status "upload busy"
totalSize 431203849 [0x19b3a609]
uploadedAtm "37015918"
uploadedSoFar "19719566"
[94854] Array (@24ff7fd9)
forceUpload false
length 0
name "testdocument.indd"
packageId "16842"
progressStatus "allowed"
singleItemSize 6344704 [0x60d000]
singleItemUploadedSoFar 6344704 [0x60d000]
sortIndex 1338984606428 [0x137c1b3aadc]
status "upload busy"
totalSize 862407698 [0x33674c12]
uploadedAtm "6344704"
uploadedSoFar ""
length 2
现在我想根据 sortIndex 对其进行排序。我这样尝试过:
packageData.data.packages.sortOn("sortIndex");
它已排序,但问题是我的索引更改为 0, 1, 2, ... 如下所示:
packages Array (@24ff99c1)
[0] Array (@24ff9809)
forceUpload false
length 0
name "testdocument.indd"
packageId "99767"
progressStatus "allowed"
singleItemSize 50582294 [0x303d316]
singleItemUploadedSoFar 17296352 [0x107ebe0]
sortIndex 1338984578952 [0x137c1b33f88]
status "upload busy"
totalSize 431203849 [0x19b3a609]
uploadedAtm "37015918"
uploadedSoFar "19719566"
[1] Array (@24ff7fd9)
forceUpload false
length 0
name "testdocument.indd"
packageId "16842"
progressStatus "allowed"
singleItemSize 6344704 [0x60d000]
singleItemUploadedSoFar 6344704 [0x60d000]
sortIndex 1338984606428 [0x137c1b3aadc]
status "upload busy"
totalSize 862407698 [0x33674c12]
uploadedAtm "6344704"
uploadedSoFar ""
length 2
如何在不丢失索引的情况下对数组进行排序?任何帮助,将不胜感激。