Delete confirmation triggered twice in an inner repeater
See original GitHub issueMy JS looks like this:
$('.out_repeater').repeater({
show: function () {
$(this).slideDown();
},
hide: function (deleteElement) {
if (confirm('Are you sure you want to delete this element?')) {
$(this).slideUp(deleteElement);
}
},
isFirstItemUndeletable: true,
repeaters: [{
selector: '.in_repeater',
show: function () {
$(this).slideDown();
},
hide: function (deleteElement) {
if (confirm('Are you sure you want to delete this element?')) {
$(this).slideUp(deleteElement);
}
}
}]
});
For some reason when the delete button for an item inside the “in_repeater”, it triggers the “Are you sure” confirmation twice.
Everything else works fine!
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery.repeater/1.2.1/jquery.repeater.min.js"></script>
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top Results From Across the Web
Ruby on Rails : Delete confirmation pop-up dialog displaying ...
When I click on "Delete Campaign" link, I am getting confirmation pop-up twice. This is happening on client's production environment only. Using Ruby...
Read more >Nested repeater performance issue. Item events being called ...
"The repeater calls databind on all its item children in the ItemDataBound event. So the inner repeater is databound once by the outer...
Read more >Gravity Forms Nested Forms | Gravity Forms Repeater Add-on
Gravity Forms Nested Forms also works as a Gravity Forms Repeater! ... Child entries can be edited by clicking Edit and deleted by...
Read more >how to get repeater's button id for updatepanel triggers
Hi guys, i have a button in a repeater with update panel. now, the problem is, the triggers controlID is not able get...
Read more >frm_validate_field_entry - Formidable Forms
The Pro validation will remove any error messages for fields that are ... 31 to the ID of the confirmation field (second field)...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
$list.on(‘click’, ‘[data-repeater-delete]’, function(event) { event.stopImmediatePropagation(); // add this, It works for me perfectly // event.stopPropagation(); var self = $(this).closest(‘[data-repeater-item]’).get(0); hide.call(self, function() { $(self).remove(); setIndexes($items(), getGroupName(), fig.repeaters); }); });
Thanks @martinmurciego it’s save my day.
Please, give a more detailed example in jsfiddle or codepen about eliminating nested repeaters, since I have this same problem. As I must respond with a different behavior to the slideUp and slideDown of each repeater I need to be able to identify each one: https://github.com/DubFriend/jquery.repeater/issues/98#issue-383246502 Some alternative or it will be that the developer can update this suggested change in a new version.