Skip to content
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

reattach event handler after a jquery .html() #276

Open
olvani opened this issue Nov 6, 2019 · 0 comments
Open

reattach event handler after a jquery .html() #276

olvani opened this issue Nov 6, 2019 · 0 comments

Comments

@olvani
Copy link

olvani commented Nov 6, 2019

Your script works fine when loading a page but when we refresh the list of elements with .html() after call ajax, I attach again the event after but everything does not work properly like the ondrop.

$ ( "# Listeelements") html (response).

//this click below linked on the element about delete works
$ ('. BtnImageDelete'). On ('click', function (event) {
....
});

//this sortable below linked on the element about sort works badly
//the drag works but the drop zone is not displayed and the element does not intercalate. Once //released it returns to its original position.

var group = $ ('#sort-it ol.ollp') sortable ({
group: 'ollp',
delay: 500,
onDrop: function (item) {
onDropImage (item, group);
}
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant