datagrid中的url参数传递


我们通过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,
}
});


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM