AJAX reordered list back to yesod. THIS TOOK 3 HOURS. Aargh
This commit is contained in:
parent
e0e01ee671
commit
6af91dadb8
4 changed files with 19 additions and 25 deletions
|
@ -11,8 +11,8 @@
|
|||
Repositories
|
||||
<table .table .table-condensed>
|
||||
<tbody #costsortable>
|
||||
$forall (_num, name, actions) <- repolist
|
||||
<tr .repoline>
|
||||
$forall (num, name, (uuid, actions)) <- repolist
|
||||
<tr .repoline ##{"costsortable_" ++ fromUUID uuid}>
|
||||
<td .handle>
|
||||
<i .icon-resize-vertical></i>
|
||||
#{name}
|
||||
|
|
|
@ -8,8 +8,14 @@ $(function() {
|
|||
},
|
||||
stop: function(event, ui) {
|
||||
ui.item.children(".draghide").show();
|
||||
var list = $("#costsortable").sortable("toArray");
|
||||
var moved = ui.item.attr("id");
|
||||
$.ajax({
|
||||
'url': "http://localhost/testajax",
|
||||
'url': "@{RepositoriesReorderR}",
|
||||
'data': {
|
||||
'moved': moved,
|
||||
'list': list
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue