$(document).ready(function(){
$('#tag_id').tabs({
onSelect:function(title){
switch (title){
case "待办列表":
$("#tab_dblb").attr('url',"<%=basePath%>case/findAllCase?tabType=dblb");
break;
case "领导督办":
var urlnew = $("#basePath").val()+"case/findAllCase?tabType=lddb";
$("#tab_lddb").datagrid('options').url=urlnew;
$("#tab_lddb").datagrid('reload');
break;
case "回退申请":
var urlnew = $("#basePath").val()+"case/findAllCase?tabType=htsq";
$("#tab_htsq").datagrid('options').url=urlnew;
$("#tab_htsq").datagrid('reload');
break;
case "延期申请":
var urlnew = $("#basePath").val()+"case/findAllCase?tabType=yqsq";
$("#tab_yqsq").datagrid('options').url=urlnew;
$("#tab_yqsq").datagrid('reload');
break;
case "挂账申请":
var urlnew = $("#basePath").val()+"case/findAllCase?tabType=gzsq";
$("#tab_gzsq").datagrid('options').url=urlnew;
$("#tab_gzsq").datagrid('reload');
break;
case "多部门协办申请":
var urlnew = $("#basePath").val()+"case/findAllCase?tabType=dbmxbsq";
$("#tab_dbmxbsq").datagrid('options').url=urlnew;
$("#tab_dbmxbsq").datagrid('reload');
break;
case "待结案":
var urlnew = $("#basePath").val()+"case/findAllCase?tabType=dja";
$("#tab_dja").datagrid('options').url=urlnew;
$("#tab_dja").datagrid('reload');
break;
default:
return;
}
}
});
$('#tag_id').tabs({
onSelect:function(title){
switch (title){
case "待办列表":
$("#tab_dblb").attr('url',"<%=basePath%>case/findAllCase?tabType=dblb");
break;
case "领导督办":
var urlnew = $("#basePath").val()+"case/findAllCase?tabType=lddb";
$("#tab_lddb").datagrid('options').url=urlnew;
$("#tab_lddb").datagrid('reload');
break;
case "回退申请":
var urlnew = $("#basePath").val()+"case/findAllCase?tabType=htsq";
$("#tab_htsq").datagrid('options').url=urlnew;
$("#tab_htsq").datagrid('reload');
break;
case "延期申请":
var urlnew = $("#basePath").val()+"case/findAllCase?tabType=yqsq";
$("#tab_yqsq").datagrid('options').url=urlnew;
$("#tab_yqsq").datagrid('reload');
break;
case "挂账申请":
var urlnew = $("#basePath").val()+"case/findAllCase?tabType=gzsq";
$("#tab_gzsq").datagrid('options').url=urlnew;
$("#tab_gzsq").datagrid('reload');
break;
case "多部门协办申请":
var urlnew = $("#basePath").val()+"case/findAllCase?tabType=dbmxbsq";
$("#tab_dbmxbsq").datagrid('options').url=urlnew;
$("#tab_dbmxbsq").datagrid('reload');
break;
case "待结案":
var urlnew = $("#basePath").val()+"case/findAllCase?tabType=dja";
$("#tab_dja").datagrid('options').url=urlnew;
$("#tab_dja").datagrid('reload');
break;
default:
return;
}
}
});
});
注:点击每个tab触发onselect方法,初始化datagrid的options对象时赋予请求连接url,然后再重新加载。
注:在mybatis的mapper.xml文件中运用条件判断标签<if test="_parameter"></if> ,传过来的参数名称一定用"_parameter"代替。