We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hi guys, he's the issue I'm facing using parentProperty options.
var data2 =[ { id: 1, created_at: '2020-05-09T16:13:04.896Z', folder_id: 1, 'Filess.name': 'MyFirstLesson' }, { id: 2, created_at: '2020-05-11T16:13:04.896Z', folder_id: 2, 'Filess.name': 'MyFirstLesson' }, { id: 3, created_at: '2020-05-11T16:13:04.896Z', folder_id: 3, 'Filess.name': 'MyFirstLesson' }, { id: 4, created_at: '2020-05-09T16:13:04.896Z', folder_id: 1, 'Filess.name': 'Meeting1' }, { id: 5, created_at: '2020-05-16T16:13:04.896Z', folder_id: 1, 'Filess.name': 'SetupRoom' }, { id: 6, created_at: '2020-05-17T16:13:04.896Z', folder_id: 1, 'Filess.name': 'SetupRoom' }, { id: 7, created_at: '2020-05-17T16:13:04.896Z', folder_id: 1, 'Filess.name': 'SetupRoom' }, { id: 8, created_at: '2020-05-20T15:26:36.656Z', folder_id: 1, 'Filess.name': 'Annotation 2020-04-08 135240.jpg' } ]
arrayToTree(data2, {parentProperty: 'folder_id})
returns empty array
The text was updated successfully, but these errors were encountered:
I think this is because your top-level node is pointing to itself i.e. it has id and folder_id both equal to 1
{ id: 1, created_at: '2020-05-09T16:13:04.896Z', folder_id: 1, 'Filess.name': 'MyFirstLesson' },
Sorry, something went wrong.
No branches or pull requests
hi guys, he's the issue I'm facing using parentProperty options.
var data2 =[
{
id: 1,
created_at: '2020-05-09T16:13:04.896Z',
folder_id: 1,
'Filess.name': 'MyFirstLesson'
},
{
id: 2,
created_at: '2020-05-11T16:13:04.896Z',
folder_id: 2,
'Filess.name': 'MyFirstLesson'
},
{
id: 3,
created_at: '2020-05-11T16:13:04.896Z',
folder_id: 3,
'Filess.name': 'MyFirstLesson'
},
{
id: 4,
created_at: '2020-05-09T16:13:04.896Z',
folder_id: 1,
'Filess.name': 'Meeting1'
},
{
id: 5,
created_at: '2020-05-16T16:13:04.896Z',
folder_id: 1,
'Filess.name': 'SetupRoom'
},
{
id: 6,
created_at: '2020-05-17T16:13:04.896Z',
folder_id: 1,
'Filess.name': 'SetupRoom'
},
{
id: 7,
created_at: '2020-05-17T16:13:04.896Z',
folder_id: 1,
'Filess.name': 'SetupRoom'
},
{
id: 8,
created_at: '2020-05-20T15:26:36.656Z',
folder_id: 1,
'Filess.name': 'Annotation 2020-04-08 135240.jpg'
}
]
arrayToTree(data2, {parentProperty: 'folder_id})
returns empty array
The text was updated successfully, but these errors were encountered: