Is there a way to format the values on the additional information panel
Hi Matt,
Sorry it's me again...
Is there any way to customize the template for the properties on the Additional Information panel? We'd like to format the dates, hide empty values, and provide a custom view for a JSON object.
Is that possible at all?
For info we have already set the view in editor.config but that seems to only apply to the edit overlay.
If that's not possible then I may need to look into creating a custom order edit screen altogether, however that seems like a huge job 🙈
Hmm, I think your findings may be correct that there is no custom way atm to change the view when they are just being displayed.
Maybe we need to introduce another view for display.
Im currently at Codegarden so will have to review this when I return. The only other option really right now would be to use custom property editors for editing that stores values in a friendly displayable format.
For future self, and anyone else that needs to go down this path, it's actually not as much work as I expected to create a custom Order Editor.
As the docs say you can override the entire order editor by addding a view key to storeAlias.order.editor.config.
{
view: "/my/custom/view.html"
}
So I simply copied the default order editor that ships with Vendr and bastardized it to my own ends. I ended up moving some of the panels around too which was a nice bonus.
One thing that tripped me up is that you'll need to include all the keys from the default config. Seems obvious in hindsight but knowing this may save you a time. For example:
I'm quite pleased with the outcome, it's great that Vendr allow you to do stuff like this. I'll have to make sure that future changed to the Vendr framework get ported across to the custom template though so something to beware of.
Is there a way to format the values on the additional information panel
Hi Matt,
Sorry it's me again...
Is there any way to customize the template for the properties on the Additional Information panel? We'd like to format the dates, hide empty values, and provide a custom view for a JSON object.
Is that possible at all?
For info we have already set the view in editor.config but that seems to only apply to the edit overlay.
If that's not possible then I may need to look into creating a custom order edit screen altogether, however that seems like a huge job 🙈
Any help is greatly appreciated.
TIA
Hi Philip
Hmm, I think your findings may be correct that there is no custom way atm to change the view when they are just being displayed.
Maybe we need to introduce another view for display.
Im currently at Codegarden so will have to review this when I return. The only other option really right now would be to use custom property editors for editing that stores values in a friendly displayable format.
Hi Matt,
Yeah if there was a way to specify a view + config for the info panel that would be a perfect solution. 👍🏻
Thanks for the quick reply and enjoy Codegarden! 🍻
For future self, and anyone else that needs to go down this path, it's actually not as much work as I expected to create a custom Order Editor.
As the docs say you can override the entire order editor by addding a
view
key tostoreAlias.order.editor.config
.So I simply copied the default order editor that ships with Vendr and bastardized it to my own ends. I ended up moving some of the panels around too which was a nice bonus.
One thing that tripped me up is that you'll need to include all the keys from the default config. Seems obvious in hindsight but knowing this may save you a time. For example:
I'm quite pleased with the outcome, it's great that Vendr allow you to do stuff like this. I'll have to make sure that future changed to the Vendr framework get ported across to the custom template though so something to beware of.
is working on a reply...