$(function() {
serach();
});
function setGridHeight(){
var docHeight = window.document.body.offsetHeight;
var winHeight = document.documentElement.clientHeight;
$("#batteryOutletsGrid").height(winHeight - docHeight + 40 + "px");
}
//add by buyabo 查询次数统计 end
// 监听界面回车按钮事件
document.onkeydown = function(e) {
// 兼容FF和IE和Opera
var theEvent = e || window.event;
var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
if (code == 13) {
serach();
return false;
}
return true;
};
var key;
function serach() {
key = $('#keyName').val().toUpperCase();
$('#search').attr('disabled', true);
// $('#content_page').html('
努力查询中...
');
$('#batteryOutletsGrid').show();
var grid = nui.get("batteryOutletsGrid");
grid.load({
"entity" : key
});
$('#search').attr('disabled', false);
// });
// } else {
// $('#content_page').html('抱歉,未查询到电池网点信息
');
// $('#download_button').text('');
// }
// $('#search').attr('disabled', false);
// },
// error : function(data) {
// $('#content_page').html('抱歉,查询失败,请稍后再试
');
// $('#download_button').text('');
// $('#search').attr('disabled', false);
// }
// });
}
function getContextPath(action) {
var pathname = window.location.pathname.substring(1);
var pathnameArr = pathname.split('/');
var actionURL = 'http://' + window.location.host + '/' + pathnameArr[0] + action;
return actionURL;
}