Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesUsing dnnConfirm dialog from JavascriptUsing dnnConfirm dialog from Javascript
Previous
 
Next
New Post
5/21/2013 10:21 AM
 
In a DNN module I want to use a OK / Cancel dialog which is styled like the other popups (e.g. Login popup). I tried to get this to work with the $.dnnConfirm JQueryUI extension, but this seems to work when bound to an anchor only. Also, I would not know how to specify the callback required when "OK" was clicked since the "buttons" property cannot be used. Is there a more suitable way to display a DNN style popup from javascript?
 
New Post
5/22/2013 8:32 AM
 

This is what I came up with. It does not really look as if the "button" object is needed, but I don't know how else to use dnnConfirm. Only if one hits "OK" the callback function will be executed (the data object can be anything one wants to pass to callback, where it can be used like function (event) {var passedData = event.data); }).

    self.confirmDialog = function (message, callback, data) {

        var button = $('<button/>');

        button.dnnConfirm({
            text: message,
            yesText: "OK",
            noText: "Cancel",
            title: "Confirm",
            isButton: true
        });

        button.trigger("click");
        button.click(data, callback);
    };
 
New Post
10/17/2015 5:52 PM
 
How did you go about calling your JS method that you created?

Will Strohl

Upendo Ventures Upendo Ventures
DNN experts since 2003
Official provider of the Hotcakes Commerce Cloud and SLA support
 
New Post
10/20/2015 8:30 AM
 

I realize this is a pretty old topic, but for future reference's sake I'll answer here anyway.

The dnnConfim-plugin was never meant to be used that way; it's sole purpose is to provide a way to have a user confirm or cancel a certain action that is bound to the click event of an anchor or (image)button element. This is why you can only bind it to a DOM element that is meant to be clickable in some way and why you can't define the callback method for the 'Ok' button.

DNN however exposes a CSS class, 'dnnPopup', for this. You can use it together with jQuery's dialog method to display DNN-styled dialog-popups. Use the 'dialogClass' option to add 'dnnPopup' to it's class list.

By the way: this is also how DNN itself does it, under the hood :-)

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesUsing dnnConfirm dialog from JavascriptUsing dnnConfirm dialog from Javascript


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.

Content Layout

Subscribe to DNN Digest

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out