Comments (11)
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.
I show the changes in the picture:
from viewer-components-react.
@grigasp seems like this is logged by @itwin/property-grid-react
from viewer-components-react.
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:
-
Supply PreferencesStorage implementation that handles the persistence. You choose where/how the settings are persisted. This would be specific to the property grid component.
-
Leave
preferencesStorage
option empty (or supply IModelAppUserPreferencesStorage) and supply UserPreferencesAccess as auserPreferences
setting when initializing IModelApp. In this case providedUserPreferencesAccess
could be shared across multiple iTwin.js components.
from viewer-components-react.
@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.
... 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.
In fact, I've done this but PropertyGrid doesn't work
from viewer-components-react.
I have also selected some element.
from viewer-components-react.
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.
@grigasp
thanks~
https://github.com/jutian88/appui
from viewer-components-react.
I will take your suggestion and try to do.
@grigasp Best wishes to you
from viewer-components-react.
Related Issues (20)
- Property widget: Selection change causes property widget to auto-focus
- Tree widget: Switch to using `@itwin/presentation-hierarchies-react`
- Models tree: Focus mode
- Property widget: Features telemetry reporting
- Tree widget: Features' telemetry reporting
- Models Tree - Request performance improvement during visibility on/off with multi selection HOT 4
- Spatial tree - Request performance improvement during visibility on/off
- Tree Widget: Add ability to show badge in tree selector
- Tree widget: Performance telemetry reporting
- Property widget: Performance telemetry reporting
- Tree & Property widgets: Clean up internal APIs exposed through barrel file
- Tree displays zero items whenever the unit system changes HOT 1
- Tree widget: Support checkbox actions on multiple selected nodes
- @itwin/measure-tools-react, @itwin/map-layers: Support AppUI 4.10+
- Tree widget: README & CHANGELOG update
- Tree widget: Tests
- Tree widget: Reuse subject models cache between Models tree hierarchy definition and visibility handler
- Tree widget: Make use of subject models cache in Models tree instance key paths lookup functions
- Tree widget: Review Models tree focus mode performance
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from viewer-components-react.