}// ;
@SuppressWarnings({ "rawtypes" })
private IResult getGridData(Method method, IRequest params) {
ISearch search = createSearchTemplete();
boolean pages = params.containsParamsKey(IGridEnum.PAGE.getCode());
int page = 0, pageRows = 0, startRow = 0;
if (pages) {
page = params.getParamsAsInteger(IGridEnum.PAGE.getCode());
pageRows = params.getParamsAsInteger(IGridEnum.PAGEROWS.getCode());
startRow = (page - 1) * pageRows;
search.setFirstResult(startRow).setMaxResults(pageRows);
}
boolean sort = params.containsParamsKey(IGridEnum.SORTCOLUMN.getCode())
&& !CapString
.isEmpty(params.get(IGridEnum.SORTCOLUMN.getCode()));
if (sort) {
String[] sortBy = params.get(IGridEnum.SORTCOLUMN.getCode()).split(
"\\|");
String[] isAscAry = params.get(IGridEnum.SORTTYPE.getCode(), "asc")
.split("\\|");
for (int i = 0; i < sortBy.length; i++) {
String isAsc = (i < isAscAry.length) ? isAscAry[i] : "asc";
search.addOrderBy(sortBy[i], !IGridEnum.SORTASC.getCode()
.equals(isAsc));
}
}
IGridResult result = null;
try {