Haven't used it myself but the docs seem pretty comprehensive. What exactly are you having problems with? Do you have any code already we could take a look at?
This is all the documentation available, so I'm not sure about comprehensive. Also it seem to be copy+paste from dialogservice.mediapicker.
propertyDialog(options, editor, value)
Opens a dialog with a chosen property editor in, a value can be passed to the modal, and this value is returned in the callback
Parameters
options – {Object} – mediapicker dialog options object
options.callback – {Function} – callback function
editor – {String} – editor to use to edit a given value and return on callback
value – {Object} – value sent to the property editor
Returns
{Object} – modal object
All in all I'm not sure what the method does, and I'm not sure how to pass a certain property editor to the method.
angular.module("umbraco").controller("myController",
[
"$scope",
"dialogService",=
function ($scope, dialogService) {
dialogService.propertyDialog({
editor: "", // I believe this is the DTDID of the editor to render
value: "", // This is the stored value of the editor
callback: function(value){
// Do something with the value
}
});
}
]);
I believe the above should work. Basically calling the propertyDialog with an editor ID and a value for that editor (ie, the last stored value) it'll launch a dialog with that specific editor control. The user will interact with it and on clicking save, your callback method will be called passed down the updated value for you to do whatever you want with it (store it, then pass it into the dialog service again when they want to edit the value).
Hello Guys,
I have flagged this as a bug. As to me there is no controller or anyway for the view to know about the item propertyTypeToRender. I would say this was started and not used in the main core product of Umbraco and thus has got forgotten about & never finished.
Not sure if this is of use, but you can pass data into the dialogService through the (undocumented) dialogData property. I use this in my Trace Log Viewer to pass in a logItem object to the service:
Yep good point Dan.
Passing dialogData into your modal back and forth is insanely useful and Jamie could write his own HTML modal view and use the Open method on the dialogService if needed to.
Hi gents,
Just wanted to say, I did use the open function with dialogData when resolving this issue.
I should probably mark this as closed. Sorry I wasn't a bit more clear in my responses last week. I found a solution which involved me writing my own dialog.
Thanks,
Jamie
EDIT: oops, sorry Monday morning only half reading my emails. This was totally the wrong post I responded to! Leaving this post here for transparency. :P
dialogService.propertyDialog
Hi
Has anyone on here tried using dialogService.propertyDialog? http://umbraco.github.io/Belle/#/api/umbraco.services.dialogService
I want to open a dialog with either a custom propery editor or one of the build-in ones, fx. Umbraco.Integer?
Some ideas how to?
Hey Tom,
Haven't used it myself but the docs seem pretty comprehensive. What exactly are you having problems with? Do you have any code already we could take a look at?
Many thanks
Matt
Hi Matt,
This is all the documentation available, so I'm not sure about comprehensive. Also it seem to be copy+paste from dialogservice.mediapicker.
All in all I'm not sure what the method does, and I'm not sure how to pass a certain property editor to the method.
Hi Tom,
Ok, lets see if an example will help.
I believe the above should work. Basically calling the propertyDialog with an editor ID and a value for that editor (ie, the last stored value) it'll launch a dialog with that specific editor control. The user will interact with it and on clicking save, your callback method will be called passed down the updated value for you to do whatever you want with it (store it, then pass it into the dialog service again when they want to edit the value).
Is that any clearer?
Many thanks
Matt
bringing up this old thread again...
when I look in umbraco.services.js this is what is being executed:
When looking at the template 'views/common/dialogs/property.html' only thing in there is:
Maybe its just me - but that doesn't seem to do anything...?
Hey folks,
Sorry to necro the thread. I'm using v7.1.7 and am also curious to what the below bit of code does.
I can't find any directive in reference to it. The documentation is fairly clear but this doesn't really render anything.
Thanks,
Jamie
Hello Guys,
I have flagged this as a bug. As to me there is no controller or anyway for the view to know about the item propertyTypeToRender. I would say this was started and not used in the main core product of Umbraco and thus has got forgotten about & never finished.
The view is mainly empty:
https://github.com/umbraco/Umbraco-CMS/blob/eae00873073f20c60e355ec6e95ff6259ad2652b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/property.html
The propertyDialog requires us to pass more data in, such as the editor to use and the existing value if set already along with some other options:
https://github.com/umbraco/Umbraco-CMS/blob/eae00873073f20c60e355ec6e95ff6259ad2652b/src/Umbraco.Web.UI.Client/src/common/services/dialog.service.js#L487
But looking at the main function in the dialogService of openDialog it does nothing with these values currently.
I have raised an issue on the bug tracker to be voted up.
http://issues.umbraco.org/issue/U4-5610
Cheers,
Warren
Not sure if this is of use, but you can pass data into the dialogService through the (undocumented) dialogData property. I use this in my Trace Log Viewer to pass in a logItem object to the service:
It is then "magically" injected into the detail.html view.
Yep good point Dan.
Passing dialogData into your modal back and forth is insanely useful and Jamie could write his own HTML modal view and use the Open method on the dialogService if needed to.
Also don't forget to vote that bug/issue up so it does get seen by someone at the Umbraco HQ for a response.
http://issues.umbraco.org/issue/U4-5610
Hi gents,
Just wanted to say, I did use the open function with dialogData when resolving this issue.
I should probably mark this as closed. Sorry I wasn't a bit more clear in my responses last week. I found a solution which involved me writing my own dialog.
Thanks,
Jamie
EDIT: oops, sorry Monday morning only half reading my emails. This was totally the wrong post I responded to! Leaving this post here for transparency. :P
Hi Dan,
the width is applied correctly in your dialog to 800? I have tested this now, but the width is always set to the default value.
Best,
Sören
Hi Dan,
I have found it. The width option doesn't work for me. But I have used the modalClass option and add a own css class. This works for me.
Best,
Sören
Yeah, it doesn't work for me, either, Soren. It looks like it hasn't been implemented, even though it appears you can use it.
I have created an issue report:
http://issues.umbraco.org/issue/U4-6367
Please vote for it.
Cheers,
Sören
is working on a reply...