我想显示网格但是当我点击按钮获取信息时,没有显示任何网格或任何数据。我在" href"中进行了ajax调用。网格属性(" ajaxLlenarTablaAssistance"):
@Actions( { @Action(value = "/ajaxLlenarTablaAssistance", results = { @Result(name = "success", type = "json") }) })
if(user != null){
if(user.equals(Constants.NOT_USER)){
request.getSession().setAttribute("code", Constants.NOT_AUTHENTICATE_CODE);
response.sendRedirect("managementError");
log.info(logPattern.buildPattern(methodName, idTransaction, "FAILURE.... DONT USER AUTHENTICATE...."));
}else{
obtenerTablaAssistance();
ordenarTablaAssistance();
}
} else {
request.getSession().setAttribute("code", Constants.NOT_AUTHENTICATE_CODE);
response.sendRedirect("managementError");
log.info(logPattern.buildPattern(methodName, idTransaction, "FAILURE.... DONT USER AUTHENTICATE...."));
finalize();
}
return SUCCESS;
}
private void ordenarTablaAssistance() {
gridAssistance = new ArrayList<DetailProm>();
try {
gridAssistance.clear();
if (listaAssistance != null) {
for (DetailProm temp : listaAssistance) {
//System.out.println("\n-N-> "+temp.getNombre());
gridAssistance.add(temp);
}
//Collections.sort(gridListaUsuarios, objComparator);
}
} catch (NullPointerException e) {
e.printStackTrace();
}
}
private ArrayList<DetailProm> gridAssistance;
@SuppressWarnings("unchecked")
private void obtenerTablaAssistance() {
DetailReportPromVUtilities detailReportUtilities=new DetailReportPromVUtilities();
listaAssistance = (List<DetailProm>) detailReportUtilities.getDetailProm("1223212112", date,nameProm.equals("") ? null : nameProm, idProm.equals("") ? null : idProm, puesto);//request.getSession().getAttribute("lstDetailProm");
if (listaAssistance == null)
records = total = 0;
else {
records = listaAssistance.size();
total = (int) Math.ceil((double) records / (double) rows);
}
}
我的Java CODE具有ajax引用的注释。当我调试时,这个类中没有任何事情发生:
<div style=" margin-bottom:30px;">
<br>
<table id="gridAssistance" class="scroll" cellpadding="0" cellspacing="0">
</table>
<div id="gridAssistance_pager"></div>
<script type="text/javascript">
jQuery(document).ready(function () {
jQuery.struts2_jquery.require("js/struts2/jquery.grid.struts2"+jQuery.struts2_jquery.minSuffix+".js");
var options_gridAssistance = {};
options_gridAssistance.frozen = false;
var options_gridAssistance_colmodels = new Array();
var options_gridAssistance_colnames = new Array();
options_gridAssistance_colmodels_idProm = {};
options_gridAssistance_colmodels_idProm.name = "idProm";
options_gridAssistance_colmodels_idProm.jsonmap = "idProm";
...
options_gridAssistance.resizable = true; options_gridAssistance.resizableoptions = "{ }"; options_gridAssistance.jqueryaction = "grid";
options_gridAssistance.id = "gridAssistance";
jQuery.struts2_jquery_grid.bind(jQuery('#gridAssistance'),options_gridAssistance);
});
</script>
</div>
未显示错误。
这是结果和生成的代码(FireBug)。没有信息,表格没有显示(我使用struts2 / javascript生成表格的代码&#34;滚动&#34 ;,具有id&#34的div; gridAssistance_pager&#34;以及下面的脚本标签这个,但它不起作用): Output
Main.scss
我在构建路径中有这个jar:
感谢您的帮助!