I am working on logframe and i want to sort my array in this order
- Impact
- Outcomes
- Output
- Activities
and i have array like this
{ id : 15 , parentId : 18 , type : OUTPUT , sequence : 1 },
{ id : 16 , parentId : 15 , type : OUTCOME , sequence : 1 },
{ id : 18 , parentId : null , type : IMPACT , sequence : 1 },
{ id : 14 , parentId : null , type : IMPACT , sequence : 2 },
{ id : 17 , parentId : 14, type : OUTCOME , sequence : 1 },
this was a raw data from database and order by via sequence
I wanted to sort it with all "IMPACT" type to be 1st on array and then so on ...
{ id : 18 , parentId : null , type : IMPACT , sequence : 1 },
{ id : 14 , parentId : null , type : IMPACT , sequence : 2 },
{ id : 16 , parentId : 15 , type : OUTCOME , sequence : 1 },
{ id : 17 , parentId : 14, type : OUTCOME , sequence : 2 },
{ id : 15 , parentId : 18 , type : OUTPUT , sequence : 1 },