//当选 彩期的时候 ,提交以下url并传三个参数
function selectform1() {
$.post("${ctx}/sports/football/grab",{lotteryType:mini.get("lotteryComp").getValue(),issue_no:mini.get("issueComb").getValue(),grabClass:'MatchGrabCk'},function(datas){
grid.setData(datas);
var len=datas.length;
$("#ddd").get(0).disabled=len>0?true:false;
},"json");
function selectform1() {
$.post("${ctx}/sports/football/grab",{lotteryType:mini.get("lotteryComp").getValue(),issue_no:mini.get("issueComb").getValue(),grabClass:'MatchGrabCk'},function(datas){
grid.setData(datas);
var len=datas.length;
$("#ddd").get(0).disabled=len>0?true:false;
},"json");
}
<td><input value="抓取对阵" type="button" οnclick="selectform2()" id="ddd" />
</td>
2.后台ACtion
/*
* 从数据库中拿 数据
*/
@RequestMapping(value="/grab",method=RequestMethod.POST)//通过post拦截grab
@ResponseBody
public List<Match> grabFromDB(LotteryType lotteryType, String issue_no,String grabClass) {
return footBallManager.getMatchByLotteryAndissueNo(lotteryType, issue_no, grabClass);//返回数据
}
1.发一个action传参,并反回一个list
2.如果有数据,那么就屏蔽 抓取对阵为不可用,变灰色