我们通过datagrid的url读取远程数据的时候,会面临传参的问题,可以直接再url的后面假如参数,也可以使用,queryParams属性

 直接加入参数

$('#user_no_role_dg').datagrid({
width: 600,
height: 500,
rownumbers: true,
remoteSort: false,
multiSort: false,
method: 'get',
url: '/user_not_with_role/' + role.id,
contentType: 'application/json',
dataType: "json",
columns: user_columns,
{#queryParams: {#}
{# role_id: role.id,#}
//}
});

使用queryParams属性
$('#user_no_role_dg').datagrid({
width: 500, height: 500,
rownumbers: true,
remoteSort: false,
multiSort: false,
method: 'get',
url: '/user_no_with_role',
contentType: 'application/json',
dataType: "json",
columns: user_columns, queryParams: {
role_id: role.id,
}
});

相关文章:

  • 2022-12-23
  • 2022-01-18
  • 2021-12-19
  • 2022-12-23
  • 2021-05-31
  • 2021-09-28
  • 2021-05-27
  • 2022-12-23
猜你喜欢
  • 2021-10-16
  • 2021-12-23
  • 2022-12-23
  • 2021-06-09
  • 2022-12-23
  • 2022-12-23
  • 2021-07-25
相关资源
相似解决方案