PDA

View Full Version : Images in ExtReact components



geniny
27 Jun 2017, 1:11 PM
What is the recommended way of displaying images in ExtReact components?For instance, I would like to display a custom image next to the title of the ExtReact ToolBar component. How would I accomplish it?

Thank you,
Yuri

Mark.Brocato
27 Jun 2017, 5:09 PM
Generally I recommend just inserting an element with a background-image or using an img element. ToolBar is a little odd because the title is overlaid in the center so there isn't a great way to position an image next to it other than injecting html in the title itself. Here is an example showing several possibilities:

https://fiddle.sencha.com/?extreact#view/editor&fiddle/228q

And from the KitchenSink's TitleBar:

https://github.com/sencha/extjs-reactor/blob/master/packages/reactor-kitchensink/src/Layout.js#L121