mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-11 01:42:34 +00:00
Implemented OrderList
This commit is contained in:
parent
7af106bf43
commit
e158ddca9d
8 changed files with 682 additions and 0 deletions
|
@ -130,4 +130,25 @@ export default class ObjectUtils {
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
static insertIntoOrderedArray(item, index, arr, sourceArr) {
|
||||
if (arr.length > 0) {
|
||||
let injected = false;
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
let currentItemIndex = this.findIndexInList(arr[i], sourceArr);
|
||||
if (currentItemIndex > index) {
|
||||
arr.splice(i, 0, item);
|
||||
injected = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!injected) {
|
||||
arr.push(item);
|
||||
}
|
||||
}
|
||||
else {
|
||||
arr.push(item);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue