text: var userMgr=(function(config,functions){
  
      /**
       * 创建datatable
       * @returns {*|jQuery}
       */
      function createTable(){
  
          var ownTable=$("#myTable").dataTable({
              "bServerSide": true,
              "sAjaxSource": config.ajaxUrls.userGetAll,
              "bInfo":true,
              "bProcessing":true,
              "bLengthChange": false,
              "bFilter": false,
              "bSort":false,
              "bAutoWidth": false,
              "iDisplayLength":config.perLoadCounts.table,
              "sPaginationType":"full_numbers",
              "oLanguage": {
                  "sUrl":config.dataTable.langUrl
              },
              "aoColumns": [
                  { "mDataProp": "name"},
                  { "mDataProp": "enterprise_name"},
                  { "mDataProp": "opt",
                      "fnRender":function(oObj){
                          return '<a href="user/update?id='+oObj.aData.user_id+'">修改</a>&nbsp;'
                              //'<a class="delete" href="'+oObj.aData.user_id+'">删除</a>';
                      }
                  }
              ] ,
              "fnServerParams": function ( aoData ) {
  
              },
              "fnServerData": function(sSource, aoData, fnCallback) {
  
                  //回调函数
                  $.ajax({
                      "dataType":'json',
                      "type":"get",
                      "url":sSource,
                      "data":aoData,
                      "success": function (response) {
                          if(response.success===false){
                              functions.ajaxReturnErrorHandler(response.error_code);
                          }else{
                              var json = {
                                  "sEcho" : response.sEcho
                              };
  
                              for (var i = 0, iLen = response.aaData.length; i < iLen; i++) {
                                  response.aaData[i].enterprise_name=response.aaData[i].enterprise.enterprise_name;
                                  response.aaData[i].opt="opt";
                              }
  
                              json.aaData=response.aaData;
                              json.iTotalRecords = response.iTotalRecords;
                              json.iTotalDisplayRecords = response.iTotalDisplayRecords;
                              fnCallback(json);
                          }
  
                      }
                  });
              },
              "fnFormatNumber":function(iIn){
                  return iIn;
              }
          });
  
          return ownTable;
      }
  
      return {
          ownTable:null,
          createTable:function(){
              this.ownTable=createTable();
          },
          tableRedraw:function(){
              this.ownTable.fnSettings()._iDisplayStart=0;
              this.ownTable.fnDraw();
          },
          delete:function(id){
              functions.showLoading();
              var me=this;
              $.ajax({
                  url:config.ajaxUrls.userDelete+"?id="+id,
                  type:"post",
                  dataType:"json",
                  success:function(response){
                      if(response.success){
                          functions.hideLoading();
                          $().toastmessage("showSuccessToast",config.messages.optSuccess);
                          me.ownTable.fnDraw();
                      }else{
                          functions.ajaxReturnErrorHandler(response.error_code);
                      }
  
                  },
                  error:function(){
                      functions.ajaxErrorHandler();
                  }
              });
          }
      }
  })(config,functions);
  
  $(document).ready(function(){
  
      userMgr.createTable();
  
      $("#myTable").on("click","a.delete",function(){
          if(confirm(config.messages.confirmDelete)){
              userMgr.delete($(this).attr("href"));
          }
          return false;
      });
  });
  
  