+
+ $('button#addusers').click(function() {
+ $('input:checkbox.user').each(function (index) {
+ if(this.checked){
+ var record_id = this.id;
+ console.log("checked")
+ console.log($(this)
+ .closest('tr') //get the enclosing tr
+ .find('td:eq(1)')); //find any using td:eq(<index>)
+ slice_users.push ("yasin.upmc@gmail.com")
+ console.log("after")
+ console.log(slice_users)
+ //console.log(user_email)
+ $.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();
+ }else{
+ alert("Rest Error for "+record_id+": "+data.error);
+ }
+ });
+
+ }
+ });
+ // TODO: refresh table
+ //window.location="/portal/institution#slices";
+ });
+