问题
By default search is disabled for the model structure panel on mobile devices...
For enabling search box in mobile devices, I am using
this.viewer.setModelStructurePanel(new Autodesk.Viewing.Extensions.ViewerModelStructurePanel(this.viewer, 'Model browser', {hideSearch: false})).
I think because of this the model structure is rebuilt and hidden model is not listed in the model browser. Can you help me solving this?
回答1:
Simply add the missing model back programmatically with
var model = NOP_VIEWER.impl.modelQueue().getHiddenModels()[0]
NOP_VIEWER.modelstructure.addModel(model)
And you might want to round out the missing configuration for your new model panel as well:
new Autodesk.Viewing.Extensions.ViewerModelStructurePanel(this.viewer, 'Model browser', {
docStructureConfig: viewer.config.docStructureConfig,
hideSearch: false,
excludeRoot: viewer.config.modelBrowserExcludeRoot,
startCollapsed: viewer.config.modelBrowserStartCollapsed,
isolate: viewer.config.modelBrowserIsolateSelectedNodes
})
来源:https://stackoverflow.com/questions/58022319/how-to-enable-search-for-the-model-structurue-panel-with-forge-viewer