New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

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...Getting StartedGetting StarteddnnConfirm jQuery PlugindnnConfirm jQuery Plugin
Previous
 
Next
New Post
3/13/2012 10:39 AM
 

Hi

I am trying to use the dnnConfirm jQuery Plugin in my new module within a dnn 6.1.3 website but it's not working. I have tried the dnnAlert and this is working fine. Not sure what I'm doing wrong but I have copied the example code from here.

My code is:

-script-

(function ($) {
// your initialization code here...
$('#<%= btnClear .ClientID%>').dnnConfirm({
text: 'Are you sure you want to delete this Product?',
yesText: 'Delete',
noText: 'Cancel',
title: 'Directory Listing Manager',
dialogClass: 'dnnFormPopup',
isButton: false
});
})(jQuery);

-/script-

  -asp:LinkButton CssClass="dnnSecondaryAction dnnLogDelete" ID="btnClear" resourcekey="btnClear" Text="Click" runat="server" /-

(replaced chevrons with dashes above)

When I click the link the page is reloaded and no confirm box is displayed. I've had a look in Firebug and there are no errors.

Any help would be most appreciated.

Thanks

Terry

 
New Post
3/15/2012 10:02 AM
 
looks fine to me - did you ensure you added a jQuery.RequestDnnPluginsRegistration(); call in your init or load of the codebehind?

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
3/16/2012 4:46 AM
 

Hi

Yes, I did have the initialisation of the jscript in there.

Having played about with it for a little longer I can now get a sample dnnConfirm box displaying by putting the javascript code within a javascript function and then calling this function on page load. If I just rely on the javascript code running at the top of the page in a script tag then nothing happens.

My next challenge is to wire this up to the delete buttons within a gridview within an update panel !

Many thanks

 
New Post
8/9/2012 5:10 PM
 

Did you find the solution?

 
New Post
9/27/2012 7:44 AM
 
For the sake of others who might be stumbling upon this same topic, searching for a solution (or at least the one the TS is/was searching for): If you put all your javascript on top of your ascx-file; put it at the bottom, to make sure all controls are rendered before the javascript gets executed.

If you want to keep it at the top, then put your function in a $(document).ready()-closure. Your script would then look like:
-----------------------
$(document).ready(
function ($) {
// your initialization code here...
$('#<%= btnClear .ClientID%>').dnnConfirm({
text: 'Are you sure you want to delete this Product?',
yesText: 'Delete',
noText: 'Cancel',
title: 'Directory Listing Manager',
dialogClass: 'dnnFormPopup',
isButton: false
});
}
);
-----------------------

I'm guessing that would probably solve the problem.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting StarteddnnConfirm jQuery PlugindnnConfirm jQuery Plugin


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.