2 libaitian weilai libaitian_weilai 于 2016.04.14 18:29 提问

【在线 等】easyui 搜索功能添加 与后台controller交互 ,前端无响应
下载平台: 打包分支: 版本:  
            </div>
            <table class="appDown">
            </table>

        </div>

$(document).ready(function() {
$('#Btnsearch').click(function(){
displaySearchQ();
});
//获取查询字段内容
function getQueryParams(){
var queryParams = {};
queryParams.searchPlat = $("#searchPlat").val();
queryParams.searchVersion = $("#searchVersion").val();
queryParams.searchBranch = $("#searchBranch").val();
return queryParams;
}
function displaySearchQ(){
debugger;
$("#search table.appDown").datagrid({
url:"rest/app/listSearch",
pageSize:20,
queryParams:getQueryParams(),
type: 'post',
dataType: 'json',
idField: "id",
pagination: true,
singleSelect: true,
pageSize: 20,
columns: [[
{field: 'id', title: '编号', width: 40},
{field: 'platform', title: '下载平台', width: 70},
{field: 'branch', title: '打包分支', width: 70},
{field: 'version', title: '版本', width: 50},
{field: 'project', title: '项目名称', width: 70},
{field: 'environment', title: '环境信息', width: 70},
{field: 'creattime', title: '打包时间', width: 135},
{
field: 'opt', title: '操作', width: 110, align: 'center', formatter: function (value, row, index) {
// return "二维码";
return "二维码 " +
" 下载";
}
}
]]
});
var pager = $('#search table.appDown').datagrid('getPager');
$(pager).pagination({
pageSize:20,
pageList:[20,40,60],
beforePageText: '第',
afterPageText: '页 共 {pages} 页',
displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录'
});
}
});

            后端 controller:
             @RequestMapping("listSearch")
@ResponseBody
public Map<String,Object> listSearch(String searchPlat,String searchVersion,String searchBranch,Integer page,Integer rows ){
    Map<String,Object> datas = new HashMap<String, Object>();
    List<Appdownload> servers = this.appDownloadService.getBranch(searchPlat,searchVersion,searchBranch,(page-1)*rows,rows);
    datas.put("rows",servers);
    datas.put("total",this.downloadMapper.getSearchKey());
    return datas;
}

1个回答

libaitian_weilai
libaitian_weilai   2016.04.14 18:47

哪位大师 帮忙 看下啊

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!