Skip to content

Instantly share code, notes, and snippets.

@selahattinunlu
Created January 26, 2016 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save selahattinunlu/6633bf2bd9d9aac7bd8f to your computer and use it in GitHub Desktop.
Save selahattinunlu/6633bf2bd9d9aac7bd8f to your computer and use it in GitHub Desktop.
jquery-ui sortable snippet
$('[data-sortable]').sortable({
axis: 'y',
update: function(event, ui) {
var data = {
model: $(this).data('model'),
sort: $(this).sortable('toArray')
}
$.ajax({
type: 'POST',
url: "{{ URL::action('ControllerName@controllerMethod') }}",
data: data
})
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment