How to lazy load menu? #4110
-
Every time the page is refreshed, all subsets of the menu are updated And the subset of the subset is obtained through the load function How can lazy loading be implemented? When clicked, the subset list is requested? You can see more than 3000 requests! code:`
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @BerQin this is most likely due to search indexing on load. You can disable it by commenting out these lines: https://github.com/nasa/openmct/blob/master/platform/search/src/services/GenericSearchProvider.js#L63-L67 Keep in mind, this will return no search results anytime you perform a search. This issue is on our radar, but we haven't settled on a solution as of yet. Hope this helps! If this doesn't solve the problem, then I would look at the |
Beta Was this translation helpful? Give feedback.
-
@BerQin The object tree is lazy-loaded, so as @jvigliotta mentioned it's probably the search indexer that you're seeing. Object providers can optionally define a So, there are a couple of potential mitigations here:
We should consider making search configurable so that it can be trivially disabled, and so that developers can choose between an "on load" and an "on demand" strategy for the in-memory indexer. |
Beta Was this translation helpful? Give feedback.
@BerQin The object tree is lazy-loaded, so as @jvigliotta mentioned it's probably the search indexer that you're seeing.
Object providers can optionally define a
search(searchTerms)
function if server-side search is supported. For eg our Couch DB provider implements this. In the event that an object provider does not define asearch
function, Open MCT will build an in-memory index of all of the objects provided by that object provider via an exhaustive tree traversal, hence all of the gets.So, there are a couple of potential mitigations here:
search(searchTerms)
function to your object provider, and Open MCT will s…