Dual control Property Editor operating master/slave
Hi,
Has anybody implemented a property editor using a dropdown and a checkbox list operating as a master slave pair. Both are populated from SQL tables outside Umbraco. Essentially I want to identify an Organisation (int) and then one or more Sites (int list) belonging to the Organisation.
The control would initialise to list all Organisations and the user can then choose an Organisation from the dropdown, the checkbox list then re-configures to list Sites for the chosen Organisation and the user can choose one or more Sites from the list.
I've been searching online, but the examples I can find are either very simple or don't seem to have the interactive element updating the checkbox list. It may be that there is another way to go but I can't find a way forward.
I have looked into the documentation and made some simple editors. However, for me, this is a big step up from the samples and I could spend a lot of time running down blind alleys.
I'm hoping someone has a suggestions for a way to think about structuring it.
Api controller for getting organisations and sites. I see 2 get methods here. One for getting the organisations and one for getting sites for the selected organisation
Angular
View that will show the dropdown and the checkbox list if a organisations is chosen
Controller : javascript that handles loading of data and setting values
Resource : this what you will use to connect to your api.
Here are some examples of talk I did a few years ago on creating custom sections in Umbraco. The same principles apply for property editors.
Dual control Property Editor operating master/slave
Hi,
Has anybody implemented a property editor using a dropdown and a checkbox list operating as a master slave pair. Both are populated from SQL tables outside Umbraco. Essentially I want to identify an Organisation (int) and then one or more Sites (int list) belonging to the Organisation.
The control would initialise to list all Organisations and the user can then choose an Organisation from the dropdown, the checkbox list then re-configures to list Sites for the chosen Organisation and the user can choose one or more Sites from the list.
I've been searching online, but the examples I can find are either very simple or don't seem to have the interactive element updating the checkbox list. It may be that there is another way to go but I can't find a way forward.
Hopefully !
Roger
Hi Roger,
To my knowledge this doesn't exist. I think you will need to create a custom property editor.
This documentation is a good starting place : https://our.umbraco.org/documentation/tutorials/Creating-a-Property-Editor/
Dave
Thanks Dave,
I have looked into the documentation and made some simple editors. However, for me, this is a big step up from the samples and I could spend a lot of time running down blind alleys.
I'm hoping someone has a suggestions for a way to think about structuring it.
Rog
Hi Roger,
Things you need are :
.NET
Api controller for getting organisations and sites. I see 2 get methods here. One for getting the organisations and one for getting sites for the selected organisation
Angular
Here are some examples of talk I did a few years ago on creating custom sections in Umbraco. The same principles apply for property editors.
Resource : https://bitbucket.org/dawoe/umbukfestival2014/src/1f7a6c03621a873b25cb709ecac43b298dad2a20/Sources/UmbUkFestival2014.Website/App_Plugins/UmbUkFest/backoffice/session.resource.js?at=master&fileviewer=file-view-default
Controller : https://bitbucket.org/dawoe/umbukfestival2014/src/1f7a6c03621a873b25cb709ecac43b298dad2a20/Sources/UmbUkFestival2014.Website/App_Plugins/UmbUkFest/backoffice/speakers/edit.controller.js?at=master&fileviewer=file-view-default
Dave
Thanks Dave,
I'll follow those and see where I get to.
Regards
Roger
Thanks Dave,
I got enough out of those to move me further forward when combined with the tutorials.
Regards
Roger
Hi Roger,
Glad to hear it could be of some help
Cool,
Let me know if you run into some issues
Dave
This git repo also contains some samples : https://github.com/dawoe/umbraco-loadbalancing-dashboard/tree/master/Sources/Our.Umbraco.LoadBalancingDashboard/App_Plugins/Our.Umbraco.LoadBalancingDashboard
Dave
is working on a reply...