|
自定义的w页面
Model.prototype.cres = function(event){
var data = this.comp('data1');
Baas.sendRequest({
"url" : "/org/test",
"action" : "javaJs",
"params" : {
"limit" : limit,
"offset" : offset
},
"success" : function(resultData) {
var append = event.options && event.options.append;
data.setTotal(resultData.count);
data.loadData(resultData.result,append);
}
});
};
对应的baas
JSONObject ret = new JSONObject();
int limit = Integer.valueOf(params.getString("limit"));
int offset = Integer.valueOf(params.getString("offset"));
JSONArray arr = new JSONArray();
Connection conn = context.getConnection("test");
PreparedStatement mysqlPstmt = null;
// 取得人员数据中插入时间最大值
String sql2 = "SELECT * FROM testx LIMIT ?, ?;";
mysqlPstmt = conn.prepareStatement(sql2);
mysqlPstmt.setInt(1, offset);
mysqlPstmt.setInt(2, limit);
ResultSet result = mysqlPstmt.executeQuery();
while(result.next()){
JSONObject obj = new JSONObject();
obj.put("name", result.getString("name"));
obj.put("age", result.getString("age"));
obj.put("address", result.getString("address"));
arr.add(obj);
}
ret.put("result", arr);
ret.put("count", 22);
return ret;
w页面可以访问到baas也返回了数组,页面也打印出了数组对象,但是却没显示出数据,为什么呢?
|
|