Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

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...Building ExtensionsBuilding ExtensionsModulesModulesLooking for a datagrid/view dnnConfirm delete sampleLooking for a datagrid/view dnnConfirm delete sample
Previous
 
Next
New Post
7/31/2014 3:44 PM
 
All,

Does anyone know of a good sample or tutorial for building a module using a datagrid or datagridview that uses the dnnConfirm button to delete records? I played around with something today but wasn't able to get it working and thought there may be something freely (or cheaply) available.

If not, maybe I can seek assistance in what I'm trying to achieve.

Here's the column in my datagird:

Code:

< asp:templatecolumn >
< itemtemplate >
< ul id="dialogs-demo" class="dnnActions" >
< li >< a class="confirm dnnPrimaryAction" href="#">Delete< /a>< /li>
< /ul>
< /itemtemplate>
< /asp:templatecolumn>


Here is how I set the confirm button the anchor:

jQuery(function ($) {
$('#dialogs-demo .confirm').dnnConfirm( {
text: "Are you sure you want to delete this record?",
title: "Confirm",
isButton: true
});
});

When clicked, I get the confirmation and clicking yes works but this part doesn't appear to fire or generate an error:

$.ajax({
type: "POST",
url: "http://dnndev/Modules/Grid-Check-Box/GetDate",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
// Replace the div's content with the page method's return.
//$("#Result").text(msg.d);
msg.d);
}
});

"dnndev" is the URL to my local DNN install (v7.3.1), "modules" is the name of the parent page, "grid-check-box" is the name of the actual page and "GetDate" is this method in the code-behind in view.ascx:

[WebMethod]
public static string GetDate()
{
return "test";
}

Am I missing something simple? Maybe an easier way of doing this?

Thanks,
Mark

 
New Post
8/1/2014 2:48 AM
 
Hi Mark,

Have you had a look at the 'Task Manager' video tutorial bu Chris Hammond?

This will have all that you are looking for for building a module with data display/edit/delete etc.

The first in the series can be found here.

Another option is to look at all the other open source modules available on the forge found here.

The source for the forge modules you will find on codeplex or github

What I always do is to bind an alert onto the delete button in the datalist/grid in the itemdatabound:

Dim cmdDeleteItem As ImageButton = DirectCast(e.Item.FindControl("cmdDeleteItem"), ImageButton) cmdDeleteItem.Attributes.Add("onClick", " return confirm('" & Localization.GetString("WarningDeleteButtonText", Me.LocalResourceFile) & "');")

Hope this helps you out,

Regards,

Geoff

      
 
New Post
8/1/2014 3:38 AM
 
I dislike all the casting and uncertainty of ItemDatabound. You could try this that Michael and I cooked up

http://www.dnnsoftware.com/forums/for...

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesLooking for a datagrid/view dnnConfirm delete sampleLooking for a datagrid/view dnnConfirm delete sample


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.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out