码迷,mamicode.com
首页 > Web开发 > 详细

ajax提交

时间:2017-04-20 21:53:51      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:ajax

ajax提交


 
 //初始化加载档案列表信息
   $(function(){
	  loadAccount();
  }); 
 
   function loadAccount(){
	   var account = {};
	   account.accountName = $("#queryEmpCode").val();
	   account.name = $("#queryName").val();
	    	 $.ajax({
	             type: "post",
	             url: "<%=context%>/rest/account/accountManage",
	             data: account,
	             dataType: "json",
	             success: function(result){
	            	 $("#tb_account").bootstrapTable("destroy");
	            	 $("#tb_account").bootstrapTable({
	            			data:result,
	            			idField: "accountId",
	            			pagination: true,
	            	        pageSize: 15,
	            	        checkboxHeader:true,
	            			columns:[
	            			    {
	            			        field: "accountId",
	            			        title: "主键",
	            			        class: "col-sm-3",
	            			        visible: false
	            			    },
	            			    {
	            	              field: "empId",
	            	              title: "员工ID",
	            	              class: "col-sm-2",
	            	              visible: false
	            	          },
	            	          {
	            				    field: "accountName",
	            					title: "工号",
	            					class: "col-sm-2"
	            				},
	            	          {
	            	              field: "name",
	            	              title: "姓名",
	            	              class: "col-sm-2",
	            	          },
	            	          {
	            	              field: "accountStatus",
	            	              title: "账户状态",
	            	              class: "col-sm-3",
	            	              formatter: function(value) {
	            	           	   return accountStatus[value];
	            	             	}
	            	          },
	            	          {
	            	              field: "isWechartPucn",
	            	              title: "是否开启微信打卡",
	            	              class: "col-sm-3",
	            	              formatter: function(value) {
	            	           	    return isWechartPunch[value];
	            	              }
	            	          },
	            			   {
	            			    	field: "createTimeStr",
	            			    	title: "创建时间",
	            			    	class: "col-sm-2",
	            			   },
	            	          {
	            	          	title: "操作",
	            	          	class: "col-sm-1",
	            	          	formatter: function(value, row, index) {
	            	          		return ‘<button data-bindfunction="resetPassword" class="btn btn-primary btn-xs" data-rowid="‘ + row.empId +‘">重置密码</button>‘
	            	          		    +‘&nbsp;<button data-bindfunction="modifyStatus" class="btn btn-danger btn-xs"  data-rowid="‘ + row.empId +‘" data-status="‘+row.accountStatus+‘" data-isWechartPucn="‘+row.isWechartPucn+‘">修改</button>‘;
	            	          	}
	            	          }
	            			]
	            		});
	            	 
	                }
	          });
	     }







本文出自 “JianBo” 博客,转载请与作者联系!

ajax提交

标签:ajax

原文地址:http://jianboli.blog.51cto.com/12075002/1917855

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!