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