You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@marchaos Appreciate your support. This is a well written library that allows consumers to bring their own data structure.
With a POC running, I would like more functionality in my app.
Row Selection - selecting happens when a user clicks a row it changes style to show it is selected. One row at a time can be selected.
Row Highlighting - a highlighted row has a border around it. When a user presses up or down arrows, the highlight moves up or down a row. One row at a time can be highlighted. Pressing Enter selects the highlighted row.
What is an efficient way to implement this? My default is state variables for selectedNode and highlightedNode and when rendering each row, check if the currently rendered id is the id of the selectedNode or highlightedNode and style accordingly. Another approach is to have a selected and highlighted boolean on each node. But the rules may change with a library like this that manages its own state and refresh.
I saw the generic property meta in source code which does not cause a tree rebuild but re-rendering visible nodes. Would that be the right way to manage this piece state and refresh logic? If so, could you add to the examples folder? I see how to access meta from rowRenderer. But how to update specific node's meta values?
For highlighting on down arrow, should getNextNodeId be used? Or maybe use the node index and code like setHighlightedNode(countries[highlightedNode.index+1]). What is an efficient approach that avoids a full tree scan every time a user clicks the down arrow?
The text was updated successfully, but these errors were encountered:
@marchaos Appreciate your support. This is a well written library that allows consumers to bring their own data structure.
With a POC running, I would like more functionality in my app.
What is an efficient way to implement this? My default is state variables for
selectedNode
andhighlightedNode
and when rendering each row, check if the currently rendered id is the id of theselectedNode
orhighlightedNode
and style accordingly. Another approach is to have aselected
andhighlighted
boolean on each node. But the rules may change with a library like this that manages its own state and refresh.I saw the generic property
meta
in source code which does not cause a tree rebuild but re-rendering visible nodes. Would that be the right way to manage this piece state and refresh logic? If so, could you add to the examples folder? I see how to accessmeta
fromrowRenderer
. But how to update specific node'smeta
values?For highlighting on down arrow, should
getNextNodeId
be used? Or maybe use the nodeindex
and code likesetHighlightedNode(countries[highlightedNode.index+1])
. What is an efficient approach that avoids a full tree scan every time a user clicks the down arrow?The text was updated successfully, but these errors were encountered: