1 回答
TA贡献1877条经验 获得超6个赞
$(document).ready(function(){
$("#myInput").on("keyup", function() {
var flag = false;
var value = $(this).val().toLowerCase();
$.ajax({
url: 'getRequestSearch.php',
type: 'post',
data: {value:value},
dataType: 'json',
success:function(response){
var len = response.length;
if(len == 0){
} else{
var data = "";
var sno = 1;
for( var i = 0; i<len; i++){
var id = response[i]['id'];
var name = response[i]['name'];
var mobile = response[i]['mobile'];
var description = response[i]['description'];
var remark = response[i]['remark'];
var app_no = response[i]['app_no'];
var status = response[i]['status'];
var file = response[i]['file'];
if(file==""||file=="no")
{
file="blank";
}else
{
}
if(id=="")
{
}
else
{
data += '<tr><td data-title="Application No.">' + app_no + '</td><td data-title="ID" style="display:none;">' + id + '</td> <td class="numeric" data-title="Name">' + name + '</td><td class="numeric" data-title="Mobile">'+ mobile + '</td><td class="numeric" data-title="Description">'+ description +'</td><td class="numeric" data-title="Remark">' +remark+ '</td><td class="numeric" data-title="Status"><span class="badge badge-primary">'+ status +'</span></td> <td class="numeric" data-title="Download"><a class=" btn btn-success btn-sm" href="upload/request/'+file+'" target=_blank>Download</a></td><td class="numeric" data-title="Operation"><a href="edit-request.php?sno='+id+'" onclick="return confirmation()" ><button class="btn btn-primary btn-sm"><i class="fa fa-pencil"></i></button></a><a href="delete_request.php?sno='+id+'" onclick="return confirmation()"> <button class="btn btn-danger btn-sm"><i class="fa fa-trash-o "></i></button></a></td></tr>';
}
sno++;
$("#download-excel").attr("href", "excel-request.php?status="+status"");
$("#download-excel").attr("target","_blank");
$("#download-zip").attr("href", "download-zip-request.php?status="+status"");
$("#download-zip").attr("target","_blank");
}
$("#data").html(data)
}
}
});
});
});
我唯一看到的是 status_sel 未定义.. 现在它应该可以工作了
- 1 回答
- 0 关注
- 115 浏览
添加回答
举报