Ext调用规则返回json数据到页面
2014-03-19 10:59
197 查看
function formonload(){}
var store,grid;
Ext.onReady(function(){
var url="WF_RunRule?openagent&RuleNum=RUK001_005";
store =
new Ext.data.JsonStore({
url:url,
root:'root',
fields:['FEEDBACK_ID','FEEDBACK_NUM','DEPT_NAME','SUBMITED_EMP','STAGE_CODE','SOURCE_CODE','EMERGENCY_LEVEL','CONTACT_EMP','CONTACTER_NUMBER','FEEDBACK_DATE','REQUIRE_COMPLETE_DATE']
});
store.load();
var cm
= new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer(),
{header:"反馈单编号",dataIndex:'FEEDBACK_NUM',sortable:true},
{header:"提交部门",dataIndex:'DEPT_NAME',sortable:true},
{header:"提交人",dataIndex:'SUBMITED_EMP',sortable:true},
{header:"产生环节",dataIndex:'STAGE_CODE',sortable:true},
{header:"来源类型",dataIndex:'SOURCE_CODE',sortable:true},
{header:"紧急程度",dataIndex:'EMERGENCY_LEVEL',width:120},
{header:"问题联系人",dataIndex:'CONTACT_EMP',sortable:true,width:120},
{header:"联系电话",dataIndex:'CONTACTER_NUMBER',sortable:true,width:120},
{header:"反馈时间",dataIndex:'FEEDBACK_DATE',sortable:true},
{header:"要求解决时间",dataIndex:'REQUIRE_COMPLETE_DATE',sortable:true},
{header:"headid",dataIndex:'FEEDBACK_ID',sortable:true,hidden:true},
{header:"操作",dataIndex:'',renderer:function(){return
"<input type='button' value='启动流程' onclick='redirectToDoingPage()'>";}}
]);
var pagingBar
= new Ext.PagingToolbar({displayMsg:
'当前显示 {0} - {1} 总计 {2}',emptyMsg:
"未找到符合条件的文档",pageSize:
30,store:
store,displayInfo:
true});
grid =
new Ext.grid.GridPanel({
store:store,
cm:cm,
bbar:pagingBar,
width:document.body.clientWidth,
height:document.body.clientHeight
});
var vp
= new Ext.Viewport({
layout:'border',
items:[{region:'center',items:[grid]}],
renderTo:Ext.getDom("grid")
});
})
function redirectToDoingPage(){
var id=grid.getSelectionModel().getSelected().id;
var kid=store.getById(id).get("FEEDBACK_ID");
var url
= "/bpm/linkey_workflow_engine.nsf/workflow_doc?readform&WF_ProcessUNID=01337B82B1F244CE48257C8A002B0C26&kyid="+kid;
window.location.href=url;
//window.location.href="/bpm/linkey_workflow_engine.nsf/workflow_doc?readform&WF_ProcessUNID=FF5978D4F51D6CA348257C89000D707B&kyid="+kid;
// window.open(url,'left=0,top=0,width='+ (screen.availWidth - 10) +',height='+ (screen.availHeight-50) +',scrollbars,resizable=yes,toolbar=no');
}
function params(paras){
var url =
location.href;
var paraString
= url.substring(url.indexOf("?")+1,url.length).split("&");
var paraObj =
{}
for (i=0;
j=paraString[i];
i++){
paraObj[j.substring(0,j.indexOf("=")).toLowerCase()]
= j.substring(j.indexOf("=")+1,j.length);
}
var returnValue
= paraObj[paras.toLowerCase()];
if(typeof(returnValue)=="undefined"){
return "";
}else{
return returnValue;
}
}
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
RUK001_005规则
Sub Initialize
On Error Goto errormsg
Dim mycon As Lcconnection
Dim fldLst As New lcfieldList
Dim sql As String
Dim json As String
Set mycon= New LCConnection("oracle")
mycon.server="ERPDEV"
mycon.UserID="apps"
mycon.Password="apps"
mycon.Connect
Dim Parms As New Lcfieldlist
Dim Parm As LCField
sql=|SELECT FEEDBACK_ID,FEEDBACK_NUM,DEPT_NAME,SUBMITED_EMP,STAGE_CODE,SOURCE_CODE,CONTACT_EMP,CONTACTER_NUMBER,FEEDBACK_DATE FROM CUX_SVC_FEEDBACKS_V WHERE (rownum<5) |
Set Parm = Parms.Append ("p_appl_short_name", LCTYPE_TEXT)
Parm.text = "CUX"
mycon.Procedure="mo_global.init"
Call mycon.Call (Parms, 1, Nothing)
mycon.Procedure=""
call mycon.Execute ( sql ,fldLst )
while mycon.fetch(fldLst)
json = json + |{"FEEDBACK_NUM":"|+fldLst.lookup("FEEDBACK_NUM").text(0)+|",|
json = json + |"FEEDBACK_ID":"|+fldLst.lookup("FEEDBACK_ID").text(0)+|",|
json = json + |"DEPT_NAME":"|+fldLst.lookup("DEPT_NAME").text(0)+|",|
json = json + |"SUBMITED_EMP":"|+fldLst.lookup("SUBMITED_EMP").text(0)+|",|
json = json + |"STAGE_CODE":"|+fldLst.lookup("STAGE_CODE").text(0)+|",|
json = json + |"SOURCE_CODE":"|+fldLst.lookup("SOURCE_CODE").text(0)+|",|
'json = json + |"EMERGENCY_LEVEL":"|+fldLst.lookup("EMERGENCY_LEVEL").text(0)+|",|
json = json + |"CONTACT_EMP":"|+fldLst.lookup("CONTACT_EMP").text(0)+|",|
json = json + |"CONTACTER_NUMBER":"|+fldLst.lookup("CONTACTER_NUMBER").text(0)+|",|
json = json + |"FEEDBACK_DATE":"|+fldLst.lookup("FEEDBACK_DATE").text(0)+|"},|
wend
json = |{"root":[|+left(json,len(json)-1) +|]}|
print "content-type:application/text;charset=utf-8"
print json
Call mycon.disconnect()
Exit Sub
errormsg:
Msgbox "Rule Error:" & Str(Erl) & " " & Error
End Sub
var store,grid;
Ext.onReady(function(){
var url="WF_RunRule?openagent&RuleNum=RUK001_005";
store =
new Ext.data.JsonStore({
url:url,
root:'root',
fields:['FEEDBACK_ID','FEEDBACK_NUM','DEPT_NAME','SUBMITED_EMP','STAGE_CODE','SOURCE_CODE','EMERGENCY_LEVEL','CONTACT_EMP','CONTACTER_NUMBER','FEEDBACK_DATE','REQUIRE_COMPLETE_DATE']
});
store.load();
var cm
= new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer(),
{header:"反馈单编号",dataIndex:'FEEDBACK_NUM',sortable:true},
{header:"提交部门",dataIndex:'DEPT_NAME',sortable:true},
{header:"提交人",dataIndex:'SUBMITED_EMP',sortable:true},
{header:"产生环节",dataIndex:'STAGE_CODE',sortable:true},
{header:"来源类型",dataIndex:'SOURCE_CODE',sortable:true},
{header:"紧急程度",dataIndex:'EMERGENCY_LEVEL',width:120},
{header:"问题联系人",dataIndex:'CONTACT_EMP',sortable:true,width:120},
{header:"联系电话",dataIndex:'CONTACTER_NUMBER',sortable:true,width:120},
{header:"反馈时间",dataIndex:'FEEDBACK_DATE',sortable:true},
{header:"要求解决时间",dataIndex:'REQUIRE_COMPLETE_DATE',sortable:true},
{header:"headid",dataIndex:'FEEDBACK_ID',sortable:true,hidden:true},
{header:"操作",dataIndex:'',renderer:function(){return
"<input type='button' value='启动流程' onclick='redirectToDoingPage()'>";}}
]);
var pagingBar
= new Ext.PagingToolbar({displayMsg:
'当前显示 {0} - {1} 总计 {2}',emptyMsg:
"未找到符合条件的文档",pageSize:
30,store:
store,displayInfo:
true});
grid =
new Ext.grid.GridPanel({
store:store,
cm:cm,
bbar:pagingBar,
width:document.body.clientWidth,
height:document.body.clientHeight
});
var vp
= new Ext.Viewport({
layout:'border',
items:[{region:'center',items:[grid]}],
renderTo:Ext.getDom("grid")
});
})
function redirectToDoingPage(){
var id=grid.getSelectionModel().getSelected().id;
var kid=store.getById(id).get("FEEDBACK_ID");
var url
= "/bpm/linkey_workflow_engine.nsf/workflow_doc?readform&WF_ProcessUNID=01337B82B1F244CE48257C8A002B0C26&kyid="+kid;
window.location.href=url;
//window.location.href="/bpm/linkey_workflow_engine.nsf/workflow_doc?readform&WF_ProcessUNID=FF5978D4F51D6CA348257C89000D707B&kyid="+kid;
// window.open(url,'left=0,top=0,width='+ (screen.availWidth - 10) +',height='+ (screen.availHeight-50) +',scrollbars,resizable=yes,toolbar=no');
}
function params(paras){
var url =
location.href;
var paraString
= url.substring(url.indexOf("?")+1,url.length).split("&");
var paraObj =
{}
for (i=0;
j=paraString[i];
i++){
paraObj[j.substring(0,j.indexOf("=")).toLowerCase()]
= j.substring(j.indexOf("=")+1,j.length);
}
var returnValue
= paraObj[paras.toLowerCase()];
if(typeof(returnValue)=="undefined"){
return "";
}else{
return returnValue;
}
}
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
RUK001_005规则
Sub Initialize
On Error Goto errormsg
Dim mycon As Lcconnection
Dim fldLst As New lcfieldList
Dim sql As String
Dim json As String
Set mycon= New LCConnection("oracle")
mycon.server="ERPDEV"
mycon.UserID="apps"
mycon.Password="apps"
mycon.Connect
Dim Parms As New Lcfieldlist
Dim Parm As LCField
sql=|SELECT FEEDBACK_ID,FEEDBACK_NUM,DEPT_NAME,SUBMITED_EMP,STAGE_CODE,SOURCE_CODE,CONTACT_EMP,CONTACTER_NUMBER,FEEDBACK_DATE FROM CUX_SVC_FEEDBACKS_V WHERE (rownum<5) |
Set Parm = Parms.Append ("p_appl_short_name", LCTYPE_TEXT)
Parm.text = "CUX"
mycon.Procedure="mo_global.init"
Call mycon.Call (Parms, 1, Nothing)
mycon.Procedure=""
call mycon.Execute ( sql ,fldLst )
while mycon.fetch(fldLst)
json = json + |{"FEEDBACK_NUM":"|+fldLst.lookup("FEEDBACK_NUM").text(0)+|",|
json = json + |"FEEDBACK_ID":"|+fldLst.lookup("FEEDBACK_ID").text(0)+|",|
json = json + |"DEPT_NAME":"|+fldLst.lookup("DEPT_NAME").text(0)+|",|
json = json + |"SUBMITED_EMP":"|+fldLst.lookup("SUBMITED_EMP").text(0)+|",|
json = json + |"STAGE_CODE":"|+fldLst.lookup("STAGE_CODE").text(0)+|",|
json = json + |"SOURCE_CODE":"|+fldLst.lookup("SOURCE_CODE").text(0)+|",|
'json = json + |"EMERGENCY_LEVEL":"|+fldLst.lookup("EMERGENCY_LEVEL").text(0)+|",|
json = json + |"CONTACT_EMP":"|+fldLst.lookup("CONTACT_EMP").text(0)+|",|
json = json + |"CONTACTER_NUMBER":"|+fldLst.lookup("CONTACTER_NUMBER").text(0)+|",|
json = json + |"FEEDBACK_DATE":"|+fldLst.lookup("FEEDBACK_DATE").text(0)+|"},|
wend
json = |{"root":[|+left(json,len(json)-1) +|]}|
print "content-type:application/text;charset=utf-8"
print json
Call mycon.disconnect()
Exit Sub
errormsg:
Msgbox "Rule Error:" & Str(Erl) & " " & Error
End Sub
相关文章推荐
- Ajax调用查看页面的后台返回json格式数据
- extjs 中formPanel提交到action后返回json数据到ext中,但是ext页面不进入sucess也不进入failure
- ssh 中 jquery ajax 调用action返回的json数据并传递到页面
- jquery与后台进行数据交互--前台发单一数据对象,后台返回一个json字符串 jsp页面
- Java调用天气接口(百度天气)解析返回的JSON数据
- asp.net 使用Jquery 调用WebService返回JSON 类型数据
- javaWeb页面中Ajax原始调用方法,及数据转换成Json的原始方法总结
- Jquery Ajax 学习实例2 向页面发出请求 返回JSon格式数据
- phpStudy4——前端页面使用Ajax请求并解析php返回的json数据
- MVC使用Newtonsoft无需实体类,实现JSON数据返回给前端页面使用
- 调用远程方法,返回json数据,并解析
- JQuery.getJSON 从aspx页面返回JSON数据
- Struts2引用的jar包版本为2.0.9的,该版本没有json包,如何使用ajax返回json数据到页面
- Jquery 使用Ajax获取后台返回的Json数据后,页面处理
- jquery通过struts2请求,返回json数据,在jsp页面形成二级联动下拉列表
- java通过url调用远程接口返回json数据,有用户名和密码验证
- 使用jquery、ajax不刷新页面打印表格(返回数据类型text、json);
- jQuery调用WebService返回JSON数据
- 从jsp页面发送ajax请求,servlet接受参数并返回json数据
- HttpClient以json形式的参数调用http接口并对返回的json数据进行处理(可以带文件)