12. ajax、datagrid请求传参实例

Posted on 2017-06-01 15:13  zkx4213  阅读(853)  评论(0编辑  收藏  举报

############实例1:############

var data = {};
data.orgRoleCode = orgRoleCode;
data.orgRoleName = orgRoleName;
data.containRoleIds = containRoleIds;
data.remark = remark;

var params = {
  orgRole : data
};

 

$.ajax({
  url : url,
  type : "POST",
  data : JSON.stringify(params),
  async : false,
  contentType : 'application/json',
  success : function(data) {
   
  },
  error : function(data) {

  }
});

 

############实例2:############

var id = "";

$.ajax({
  url : url,
  type : "POST",
  data : {
    id : id
  },
  async : true,
  success : function(data) {
  
  }
});

 

############实例3:############

var params = {};
params.orgRoleId = id;
$('#viewOrgRoleGrid').datagrid({
  url : basePath + 'rest/orgRoleControllerForDQ/queryViewOrgRoleList',
  queryParams : params,
  type : 'POST',
  columns : [ [
  {
    field : 'ORGROLENAME',
    width : fixWidth(0.10),
    title : '组织名称',
    align : 'center'
  }

  ...

Copyright © 2024 zkx4213
Powered by .NET 9.0 on Kubernetes