Page 2 of 2

Re: Strange tree behaviour and mixed data in view

Posted: Mon May 25, 2020 2:57 pm
by besch1980

Hi saki,

according to your advice, I simplified the testcase. I used the "tasks example" with a small amount of data and added one more column to schedulerConfig.ts

{
            text      : 'Status',
            width     : '5em',
           
renderer({record}) {return record.status; } }

Please see my attached data.json file and have a look into the "tasks example". If scheduler has been started, everything is fine. Everything looks good and seems to be the expected result. After folding and expanding the tree elements or sorting (no custom sorters anymore) the data gets mixed up. i.e. data from column Status becomes suddenly part of the tree element and that's not correct.


Re: Strange tree behaviour and mixed data in view

Posted: Mon May 25, 2020 5:27 pm
by saki

Would you please spot the second(s) in the following video where I can observe the unwanted behavior? The data is unsorted so it sometimes seems like that some children are not wrapped in its parent.


Re: Strange tree behaviour and mixed data in view

Posted: Mon May 25, 2020 5:35 pm
by besch1980

Hi saki,

from second 21 on, you can see the problem. After you folded every "root element" and unfold it again afterwards, the string "TEST" now occours in an unfolded child row. This unwanted behaviour continues after each element you unfold.

best regards,
Ben


Re: Strange tree behaviour and mixed data in view

Posted: Tue May 26, 2020 11:19 am
by saki

The problem here is that the renderer returns undefined if the status field is missing in the data. You can use any of the following:

{
    text      : 'Status',
    width     : '5em',
    field     : 'status'
}

or

{
    text      : 'Status',
    width     : '5em',
    renderer({record}) {
        return record.status || ''; 
    }  
}

Re: Strange tree behaviour and mixed data in view

Posted: Wed May 27, 2020 9:22 am
by besch1980

Hi saki,

thanks a lot! That solvwed my issues.

Have a nice day,
Ben