Jeecg Excel 导出
/*** Jeecg Excel 导出
* 代入查询条件
*/
function JeecgExcelExport(url,datagridId){
var queryParams = $('#'+datagridId).datagrid('options').queryParams;
$('#'+datagridId+'tb').find('*').each(function() {
queryParams[$(this).attr('name')] = $(this).val();
});
var params = '&';
$.each(queryParams, function(key, val){
params+='&'+key+'='+val;
});
var fields = '&field=';
$.each($('#'+ datagridId).datagrid('options').columns, function(i, val){
if(val.field != 'opt'){
fields+=val.field+',';
}
});
//window.location.href = url+ encodeURI(fields+params);
window.location.href = url+ (fields+params);
}
会把参数传到后台过滤查询导出
实用,正好需要用到 :victory::victory:
页:
[1]