moveCurrentToPosition with TreeGrid

Posted by: metrik on 11 September 2018, 12:40 am EST

    • Post Options:
    • Link

    Posted 11 September 2018, 12:40 am EST

    Hello,

     I have noticed that function moveCurrentToPosition in CollectionView only allows to navigate between "groups" when using a FlexGrid as tree. Here is an example reproducing the problem: http://jsfiddle.net/KirillMetrik/bd5vam8g/
    

    In this example I have a Tree Grid and after creating rows I navigate to first position in the grid. Unfortunately cursor is moved to the first “group” instead of the first row.

    How can I make it move to the child row?

    Thank you!

  • Posted 11 September 2018, 4:43 pm EST

    Hi,

    The behaviour is observed because, for collectionView, there are only 4 items(which are the parent items). It is the grid’s implementation of childItemsPath which transverse the items with children and shows data in a hierarchical manner.

    So instead of using collectionView.moveCurrentToPosition, please use grid’s select method.

    Please refer to the following code snippet:

    let rowIndex = 1, colIndex = 0;
    grid.select(rowIndex, colIndex);
    

    Link to the updated fiddle: http://jsfiddle.net/xadgvh6m/

    Regards

    Sharad

  • Posted 12 September 2018, 4:53 pm EST

    Thank you, works like a charm!

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels