+ $("input:checkbox.user").click(function() {
+ user_hrn = $(this).closest('tr').find('td:eq(2)').html();
+ if(this.checked){
+ var record_id = this.id;
+ slice_users.push (user_hrn);
+ }else{
+ console.log(slice_users);
+ }
+ });
+
+ }); // post rest/user
+ $('button#addusers').click(function() {
+ $.post("/update/slice/",{'filters':{'slice_hrn':'{{slice}}'},'params':{'users':slice_users}}, function(data) {
+ if(data.success){
+ // TODO: highlight row after success
+ //$('tr[id="'+record_id+'"]').highlight();
+ mysliceAlert('Success: slice updated','success', true);
+ }else{
+ mysliceAlert('Rest Error for: '+data.error,'warning', true);
+ }
+ }); // post update slice
+
+ // TODO: refresh table
+ //window.location="/portal/institution#slices";