var table;$(document).ready(function(){table=$("#smTable").DataTable({paging:!0,scrollX:!0,processing:!0,serverSide:!0,order:[],ajax:{url:CI_ROOT+"socialmedia/getSM",type:"POST"},columnDefs:[{targets:"_all",orderable:!1},{targets:[0],width:30},{targets:[1],width:20},{targets:[2],width:50},{targets:[3],width:150}],dom:"Bfrtip",buttons:[]}),$("#update_sm").on("submit",function(e){e.preventDefault(),$(".error").html(""),$(".error").css("display","none");var t=$(this).serialize();$.ajax({type:"POST",data:t,url:CI_ROOT+"socialmedia/updateAction",dataType:"json",beforeSend:function(){$("#preloader").show()},success:function(e){if("success"==e.status)window.location.href=CI_ROOT+"social-media/list";else{$.each(e,function(e,t){$("label[for='"+e+"']").html(t)});var t=Object.keys(e);$(".error").css("display","block"),$('input[name="'+t[0]+'"]').focus()}}})})});
