-
Notifications
You must be signed in to change notification settings - Fork 601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
All Delete button not work with laravel 4 #178
Comments
I notice that as well , if you remove the class close_popup from the <button type="submit" class="btn btn-danger close_popup">Delete</button> in https://github.com/andrew13/Laravel-4-Bootstrap-Starter-Site/blob/master/app/views/admin/comments/delete.blade.php |
I'll confirm this later. Likely is fixed in develop branch. |
I encountered the same issue, delete buttons not working, or happens as @dgafitescu noticed. @andrew13 , do you have any news on this one? Thanks! |
I see the same issue, i've been debugging it in depth and came to the same conclusion, by removing close_popup the postDelete action is performed and the server sees the incoming POST call. With that class enabled, on the server end it doesn't even receive a POST action from that delete popup page. I've tested it with Advanced REST client (chrome app) and when using the _token from the GET call + the id the delete does work when manually performed. |
I already resolved it as following: #Issue 1: when click outsite the colorbox, the colorbox is close but the parrent table is not updated. Edit the file: views\admin\blogs\index.blade.php Add script to $(".iframe").colorbox function onClosed: function(){
oTable.fnReloadAjax();
} to reload the table everytime we close the colorbox #Issue 2: (this issue) I use jquery to submit the form instead of manual submit the form. Add following code to $(document).ready() function $(function() {
$('form').submit(function(event) {
var form = $(this);
$.ajax({
type: form.attr('method'),
url: form.attr('action'),
data: form.serialize()
}).done(function() {
// Optionally alert the user of success here...
parent.$.colorbox.close();
}).fail(function() {
// Optionally alert the user of an error here...
});
event.preventDefault(); // Prevent the form from submitting via the browser.
});
}); |
Note: if you use |
@andrew13 , do you have any news on this one? Thanks : ) |
What I have done to make it work... modal.blade.php $(document).ready(function(){
$('.close_popup').click(function(){
parent.oTable.fnReloadAjax();
parent.jQuery.fn.colorbox.close();
return false;
});
$(function() {
$('#deleteForm').submit(function(event) {
var form = $(this);
$.ajax({
type: form.attr('method'),
url: form.attr('action'),
data: form.serialize()
}).done(function() {
parent.jQuery.colorbox.close();
parent.oTable.fnReloadAjax();
}).fail(function() {
});
event.preventDefault();
});
});
});
$('.wysihtml5').wysihtml5();
$(prettyPrint); |
@MartinOlsansky It doesn't work for me. I added an id to my form with deleteForm. The popup doesnt close after it's finished.... Thanks, |
@asivaneswaran you still need to remove close_popup in
as suggested by @dgafitescu above. This works for me fine. |
All delete button open the modal but with confirmation it returned to list page with no delete from the list and no delete from database.
The text was updated successfully, but these errors were encountered: