|
我在action中这样写的
public static Table LoaData(String data1,String select,String dataModel,String concept,String from,String idColumn,String distinct,Map<String, Object> variables,Integer offset,String columns,Integer limit){
String ksql = "select SO_KHZL.fSXAP,(case when SO_KHZL.fSXAP = '第一家送' then '顺序被占用' end) as fPDSX from SO_KHZL SO_KHZL";//需要查询数据的ksql
Table table = KSQL.select(ksql, null, "/songhuorenwu/songhuo/data", null);//调用平台提供的API执行sql,并返回table
return table;
在页面这样的
Model.prototype.data1BeforeRefresh = function(event){
var data1 = this.comp("data1");//获取data
var grid1 = this.comp("pan");//获取展现数据的grid组件
//勾选action参数,给limit和offset参数传参
var param = new biz.Request.ActionParam();
var limit = data1.limit;//获取data的limit值 var offset = data1.getOffset();//获取data当前的offset值
param.setInteger("limit", limit);
param.setInteger("offset", offset);
biz.Request.sendBizRequest({
"context" : this.getContext(),
"action" : "newAction_0",
"parameters" : param,
"callback" : function(callbackData) {callbackData.ignoreError = false;
if (callbackData.state) {
data1.loadData(callbackData.response, false);//把返回的数据给data
grid1.refresh();//刺激grid显示数据
}
}
});
}; |
|