Code Monkey home page Code Monkey logo

Comments (11)

grigasp avatar grigasp commented on July 3, 2024 2

Thanks. I didn't realize you were using appui-test-app. The problem is that selection change doesn't get to the property widget.

The property widget uses unified selection system to find out about what's selected. The system comes with @itwin/presentation-frontend package and the components that interact with selection need to hook into it. The property widget uses Presentation library by default and hooks into unified selection automatically. However, none of the appui packages know about Presentation library or unified selection, so the graphics view component doesn't work with the system. To achieve that, you need do use a viewport component like this.

I suggest looking at @itwin/cra-template-web-viewer as a starter app. Adding @aruniverse who, I believe, can consult if needed.

from viewer-components-react.

jutian88 avatar jutian88 commented on July 3, 2024 1

it works!!
image

I show the changes in the picture:
image
image

from viewer-components-react.

GerardasB avatar GerardasB commented on July 3, 2024

@grigasp seems like this is logged by @itwin/property-grid-react

from viewer-components-react.

grigasp avatar grigasp commented on July 3, 2024

@jutian88,

The property widget, by default, uses IModelAppUserPreferencesStorage, which relies on IModelApp.userPreferences for settings persistence. The latter has to be set when initializing IModelApp, if it's not - IModelAppUserPreferencesStorage emits an error to console whenever you try to save/load a preference.

If you don't care about settings' persistence, you can just supply a no-op implementation of PreferencesStorage when creating the PropertyGridComponent.

If you want settings persistence, you have two options:

  1. Supply PreferencesStorage implementation that handles the persistence. You choose where/how the settings are persisted. This would be specific to the property grid component.

  2. Leave preferencesStorage option empty (or supply IModelAppUserPreferencesStorage) and supply UserPreferencesAccess as a userPreferences setting when initializing IModelApp. In this case provided UserPreferencesAccess could be shared across multiple iTwin.js components.

from viewer-components-react.

jutian88 avatar jutian88 commented on July 3, 2024

@grigasp
Thank you for your reply. I introduced them in order without considering persistence, but prooertyGrid reported the above error and the prooertyGrid component could not be displayed. I hope the component can be displayed. How to implement it in the code?
https://www.npmjs.com/package/@itwin/property-grid-react

from viewer-components-react.

grigasp avatar grigasp commented on July 3, 2024

... and the prooertyGrid component could not be displayed. I hope the component can be displayed. How to implement it in the code? https://www.npmjs.com/package/@itwin/property-grid-react

Sorry, from your initial comment I didn't realize the component wasn't working. Generally, the component is added to iTwin.js apps using UiItemsProvider - you can see how that's done here.

Please also note that the property grid only shows up when you select some element.

from viewer-components-react.

jutian88 avatar jutian88 commented on July 3, 2024

In fact, I've done this but PropertyGrid doesn't work
image
image

from viewer-components-react.

jutian88 avatar jutian88 commented on July 3, 2024

image
I have also selected some element.

from viewer-components-react.

grigasp avatar grigasp commented on July 3, 2024

What you have looks okay. Could you push your code to some public repo where I could have a look at it?

from viewer-components-react.

jutian88 avatar jutian88 commented on July 3, 2024

@grigasp
thanks~

https://github.com/jutian88/appui

from viewer-components-react.

jutian88 avatar jutian88 commented on July 3, 2024

I will take your suggestion and try to do.
@grigasp Best wishes to you

from viewer-components-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.