Skip to main content
June 17, 2022
Solved

Get all row Ids in gridLayout

  • June 17, 2022
  • 7 replies
  • 0 views

Hello,

I'm trying to create a gridLayout component whose components can be hierarchically selected (this means, clicking on a specific row will also select all its subrows, and their respective subrows, all the way til the last hierarchy level). 

The thing is, I've assigned an unique id to each row from which I can know its parent rows, but in order to build this selection system, I should be able to loop over all row ids so I know if they have specific parent rows. Hence, my problem is getting all row ids. Is there any way to do it?

    Best answer by harshj0001

    Hello [mention:0c05dc280cfe4144a878fa2cc299fe52:e9ed411860ed4f2ba0265705b8793d05],

    After selecting the particular Row, you can generate the index's for the other rows which you want to be selected automatically.

    After generating the index, append it into the "selectionValue" of the grid and then automatically your row will selected.

    7 replies

    harshj0001
    June 17, 2022

    Hello [mention:0c05dc280cfe4144a878fa2cc299fe52:e9ed411860ed4f2ba0265705b8793d05],

    After selecting the particular Row, you can generate the index's for the other rows which you want to be selected automatically.

    After generating the index, append it into the "selectionValue" of the grid and then automatically your row will selected.

    June 17, 2022

    Hello [mention:c09c97ff6d554cfc954848f73216d0f4:e9ed411860ed4f2ba0265705b8793d05],

    That's what I'm trying to do, but at the moment I can't seem to make it effective in terms of performance (a lot of integration calls due to the data being external)

    stefanhelzle0001
    Brainy
    June 17, 2022

    So you got the logic working, but it is slow because of web service calls. Do you have a chance to query for multiple items in one call?

    June 20, 2022

    Hi,

    I'm writing this just to let you know that I ended up getting the job done (we'll see about performance later).

    I combined my idea of "(Value in first key)-(Value in second key)-..." ids for the rows and the ideas [mention:c09c97ff6d554cfc954848f73216d0f4:e9ed411860ed4f2ba0265705b8793d05] and [mention:126a676c85024855948336691b0a7b92:e9ed411860ed4f2ba0265705b8793d05] gave me in order to create an expression rule that returned the correct ids (that I kinda had to build up given the id structure I built for the tree grid), and then apply that expression rule on the "saveSelectionTo" parameter in the grid component