7911 Posts in 1354 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Simple way to add delete confirmation in DataObjectManager?
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1480 Views |
-
Simple way to add delete confirmation in DataObjectManager?

11 September 2009 at 5:12am
IS there a simple way to add delete confirmation in DataObjectManager? I can see how to turn off the delete option but I don't want that. The problem is I find the edit and delete buttons are right next to each other and if I accidentaly hit the delete button then I lose an entry and I have hundreds of objects so then it is really hard to know what I have lost.
I guess I could get into the javascript myself and add confirmation but wondered if there is a more straightforward and futureproof way than editing the source.
-
Re: Simple way to add delete confirmation in DataObjectManager?

11 September 2009 at 6:06am
That's a good idea. I'll add that in.
-
Re: Simple way to add delete confirmation in DataObjectManager?

11 September 2009 at 6:57am
Glad you like it. I would be hesitant to use it in a client site without it cause of risk of losing data.
-
Re: Simple way to add delete confirmation in DataObjectManager?

11 September 2009 at 6:59am
I suppose I could just use complextablefield for the time being, just noticed that does have the delete option. Thanks for the quick replies too
-
Re: Simple way to add delete confirmation in DataObjectManager?

11 September 2009 at 5:20pm
How do you turn off the Delete? Mine has disappeared but I don't remember ever turning it off
. -
Re: Simple way to add delete confirmation in DataObjectManager?

22 December 2009 at 5:39am
I have managed to add delete confirmation by adding 3 lines of code to the file: dataobject_manager/javascript/dataobject_manager.js
Line 71
// Delete
$container.find('a.delete-link').unbind('click').click(function(e) {
params = $('#SecurityID') ? {'forceajax' : '1', 'SecurityID' : $('#SecurityID').attr('value')} : {'forceajax' : '1'};
$target = $(this);
deleteConfirmation = confirm('Do you really want to delete the selected item?');
if(deleteConfirmation) {
$.post(
$target.attr('href'),
params,
function() {$($target).parents('li:first').fadeOut();$(".ajax-loader").fadeOut("fast");}
);
}
e.stopPropagation();
return false;
});Hope this helps,
Daniel
| 1480 Views | ||
|
Page:
1
|
Go to Top |



