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 ExtensionsModulesModulesAdd a confirmation to delete button in a gridAdd a confirmation to delete button in a grid
Previous
 
Next
New Post
1/24/2013 7:18 AM
 
Richard,

thanks for your answer again, and your explanation sounds plausible enough. The problem is: I am not a jQuery expert as well, so maybe someone here who has enough knowledge can lead me in the right direction...

Best wishes
Michael

Michael Tobisch
DNN★MVP

dnn-Connect.org - The most vibrant community around the DNN-platform
 
New Post
1/24/2013 9:09 AM
 

Hi Michael,
Edit - Annoying post editor.  Change a.l.e.r.t to the js built in function by removing dots.

Try this... (caveat I didn't build it into a DNN module I tested it in a trivial Web App.) Pop it into script tags at the top of the page.

jQuery(function () {
jQuery(".confirmingGrid .DeleteButton") // Select items with the class DeleteButton within items with the class confirmingGrid
.click( // Attach a function that runs when they are clicked - you can probably replace this with dnnConfirm
function () {
a.l.e.r.t("Hit me. My name is " +

// Complex bit - to pick up data from a column in the same row!
// Firstly argument 2!!!
// 'this' will be the raw dom obect a user has clicked on (one of the delete buttons)
// $(this) wraps it so I can call jQuery methods on it
// parents("tr") searches upward to find the row that the button is in

// Argument 1 says look for the subscript 1 (Ie the second) td inside the context set by arg 2 (the row)
// Then I pick up the text from there.

// This is the part you will have to change to somehow get your confirmation data!
$("td:eq(1)", $(this).parents("tr")).text() ); });
});

For this to work you need to add the marker class 'confirmingGrid' (Ie a grid that can do confirmations! to the GridView, and the marker class 'DeleteButton' to the button you use to cause delete!

HTH.


Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
1/30/2013 7:54 AM
 
Hi Michael,

Was this any use to you? If you email me directly I can send you the original test project. That may make more sense.

richard at dynamisys dot co dot uk.

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
2/2/2013 6:06 AM
 
Hi Richard,

thanks, and sorry for not answering earlier - I was on the way for some days as a speaker at the DNN Roadshow in Vienna (Austria) and Munich (Germany), so I could not try it earlier.

Your script works, the problem is: only once. After a confirmed deleting one item, it seems to go to sleep - no error message, nothing. The other problem is, I tried to replace the alert function by dnnConfirm, and I get an error message that dnnConfirm is an unrecognized function. No idea yet, but the thing is "on the way"...

Thanks for your help!

Best wishes
Michael

Michael Tobisch
DNN★MVP

dnn-Connect.org - The most vibrant community around the DNN-platform
 
New Post
2/2/2013 6:20 AM
 
No worries.

Would you like to collaborate on making it work? Send me (privately - email above) what you have tried. Once we know how to do this then we can summarize what works for the group.

My bet on this one is that your module (or somthing that wraps it in the page) is using an update panel. Therefore there is no ready event. If that's true we can fix it.

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesAdd a confirmation to delete button in a gridAdd a confirmation to delete button in a grid


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