submit bulkactions with an AJAX call.

svn path=/plone.app.discussion/trunk/; revision=27720
This commit is contained in:
Timo Stollenwerk
2009-06-29 13:38:00 +00:00
parent 8df9ad9cf4
commit 502015b14e
3 changed files with 27 additions and 8 deletions
@@ -1,7 +1,7 @@
jq(document).ready(function() {
/*****************************************************************
* Check or uncheck all checkboxes.
* Check or uncheck all checkboxes
*****************************************************************/
jq("input[name='check_all']").click(function(){
if(jq(this).val()==0){
@@ -16,4 +16,23 @@ jq(document).ready(function() {
}
});
});
/*****************************************************************
* Bulk actions
*****************************************************************/
jq('form.bulkactions').submit(function(e) {
e.preventDefault();
var target = jq(this).attr('action');
var params = jq(this).serialize();
var valArray = jq('input:checkbox:checked');
jq.post(target, params, function(data) {
valArray.each(function () {
row = jq(this).parent().parent();
row.fadeOut("normal", function() {
row.remove();
});
});
});
});
});