Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kenny Burns 173 posts 305 karma points
    Oct 01, 2014 @ 10:50
    Kenny Burns
    0

    DialogService LinkPicker - Populate Values

    Hi,

    I am trying to open the dialogService.linkPicker with pre-populated values (editing a link) on a custom Sir Trevor block. So far I have (below) which does open the link picker window but is there a way to pass in prevalues? I have tried 'options' and 'dialogData' but no joy. Any thoughts?

    Cheers

    ...

    var uDialogService = ngi.get("dialogService");
    uDialogService.linkPicker({callback: block.onLinkSelected });
  • Robert Foster 459 posts 1820 karma points MVP 2x admin c-trib
    Oct 01, 2014 @ 19:18
    Robert Foster
    0

    You would need to examine the source code; and it may be that you will need to implement the desired functionality yourself - what you could do is take a copy of the relevant controller and views and then edit that in your own plugin - I've been able to augment the interface using this approach quite succesfully.

    You'll probably find that pre-populating the values will be reasonably straightforward - pass the list through as a property on the options object, for example, then use your custom picker with the dialog service.

    Hope this helps :)

    Rob.

  • John Churchley 272 posts 1258 karma points c-trib
    Aug 25, 2015 @ 09:57
    John Churchley
    0

    Did you get anywhere with this I'm trying to do a similar thing. Thanks

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Aug 25, 2015 @ 10:11
    Warren Buckley
    0

    Hello Kenny,
    Looks like you were on the right direction with dialogData.

    But this dialogData needs an object called currentTarget

    See this line in the source code for reference:

    https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js#L21

    So the currentTarget in dialogData is the set to the same object as target used in the view for the dialog that is send back out of the dialog. So inspect that object when you pick a link and see what properties & types of values you need to send in if you want to pre-populate this dialog.

    https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html

    I hope this makes sense & is useful.

    Cheers,
    Warren

Please Sign in or register to post replies

Write your reply to:

Draft